Commit 9724160
bpf/btf: Accept function names that contain dots
When building a kernel with LLVM=1, LLVM_IAS=0 and CONFIG_KASAN=y, LLVM
leaves DWARF tags for the "asan.module_ctor" & co symbols. In turn,
pahole creates BTF_KIND_FUNC entries for these and this makes the BTF
metadata validation fail because they contain a dot.
In a dramatic turn of event, this BTF verification failure can cause
the netfilter_bpf initialization to fail, causing netfilter_core to
free the netfilter_helper hashmap and netfilter_ftp to trigger a
use-after-free. The risk of u-a-f in netfilter will be addressed
separately but the existence of "asan.module_ctor" debug info under some
build conditions sounds like a good enough reason to accept functions
that contain dots in BTF.
Although using only LLVM=1 is the recommended way to compile clang-based
kernels, users can certainly do LLVM=1, LLVM_IAS=0 as well and we still
try to support that combination according to Nick. To clarify:
- > v5.10 kernel, LLVM=1 (LLVM_IAS=0 is not the default) is recommended,
but user can still have LLVM=1, LLVM_IAS=0 to trigger the issue
- <= 5.10 kernel, LLVM=1 (LLVM_IAS=0 is the default) is recommended in
which case GNU as will be used
Fixes: 1dc9285 ("bpf: kernel side support for BTF Var and DataSec")
Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Cc: Yonghong Song <yhs@meta.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/bpf/20230615145607.3469985-1-revest@chromium.org1 parent b78b34c commit 9724160
1 file changed
Lines changed: 8 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
747 | | - | |
| 747 | + | |
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
753 | | - | |
| 752 | + | |
754 | 753 | | |
755 | 754 | | |
756 | 755 | | |
| |||
767 | 766 | | |
768 | 767 | | |
769 | 768 | | |
770 | | - | |
| 769 | + | |
771 | 770 | | |
772 | 771 | | |
773 | 772 | | |
774 | 773 | | |
775 | 774 | | |
776 | | - | |
| 775 | + | |
777 | 776 | | |
778 | 777 | | |
779 | 778 | | |
780 | 779 | | |
781 | 780 | | |
782 | 781 | | |
783 | | - | |
| 782 | + | |
784 | 783 | | |
785 | 784 | | |
786 | 785 | | |
787 | 786 | | |
788 | 787 | | |
789 | 788 | | |
790 | 789 | | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | 790 | | |
795 | 791 | | |
796 | | - | |
| 792 | + | |
797 | 793 | | |
798 | 794 | | |
799 | 795 | | |
800 | 796 | | |
801 | | - | |
| 797 | + | |
802 | 798 | | |
803 | 799 | | |
804 | 800 | | |
| |||
4422 | 4418 | | |
4423 | 4419 | | |
4424 | 4420 | | |
4425 | | - | |
| 4421 | + | |
4426 | 4422 | | |
4427 | 4423 | | |
4428 | 4424 | | |
| |||
0 commit comments