Skip to content

Commit

Permalink
kernel: add MODULE_ALLOW_BTF_MISMATCH option
Browse files Browse the repository at this point in the history
BTF mismatch can occur for a separately-built module even when the ABI
is otherwise compatible and nothing else would prevent successfully
loading. Add a new config to control how mismatches are handled. By
default, preserve the current behavior of refusing to load the
module. If MODULE_ALLOW_BTF_MISMATCH is enabled, load the module but
ignore its BTF information.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
  • Loading branch information
Tianling Shen authored and chunkeey committed May 18, 2023
1 parent 8217f02 commit c07038d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,16 @@ config KERNEL_DEBUG_INFO_BTF

Required to run BPF CO-RE applications.

config KERNEL_MODULE_ALLOW_BTF_MISMATCH
bool "Allow loading modules with non-matching BTF type info"
depends on KERNEL_DEBUG_INFO_BTF
help
For modules whose split BTF does not match vmlinux, load without
BTF rather than refusing to load. The default behavior with
module BTF enabled is to reject modules with such mismatches;
this option will still load module BTF where possible but ignore
it when a mismatch is found.

config KERNEL_DEBUG_INFO_REDUCED
bool "Reduce debugging information"
default y
Expand Down

0 comments on commit c07038d

Please sign in to comment.