diff options
author | Connor O'Brien <connoro@google.com> | 2022-02-23 02:28:14 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-02-28 14:17:10 +0100 |
commit | 5e214f2e43e453d862ebbbd2a4f7ee3fe650f209 (patch) | |
tree | 457e120feecafe35cc3475dcd897f4f25dea12f1 /lib | |
parent | bpf, arm64: Feed byte-offset into bpf line info (diff) | |
download | linux-5e214f2e43e453d862ebbbd2a4f7ee3fe650f209.tar.xz linux-5e214f2e43e453d862ebbbd2a4f7ee3fe650f209.zip |
bpf: Add config to allow loading modules with BTF mismatches
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 Kconfig 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.
Suggested-by: Yonghong Song <yhs@fb.com>
Suggested-by: Michal Suchánek <msuchanek@suse.de>
Signed-off-by: Connor O'Brien <connoro@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/CAADnVQJ+OVPnBz8z3vNu8gKXX42jCUqfuvhWAyCQDu8N_yqqwQ@mail.gmail.com
Link: https://lore.kernel.org/bpf/20220223012814.1898677-1-connoro@google.com
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 1555da672275..72ca4684beda 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -339,6 +339,16 @@ config DEBUG_INFO_BTF_MODULES help Generate compact split BTF type information for kernel modules. +config MODULE_ALLOW_BTF_MISMATCH + bool "Allow loading modules with non-matching BTF type info" + depends on DEBUG_INFO_BTF_MODULES + 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 GDB_SCRIPTS bool "Provide GDB scripts for kernel debugging" help |