Commit b2a1a2aa authored by Connor O'Brien's avatar Connor O'Brien Committed by Yu Liu
Browse files

FROMGIT: bpf: btf: limit logging of ignored BTF mismatches



Enabling CONFIG_MODULE_ALLOW_BTF_MISMATCH is an indication that BTF
mismatches are expected and module loading should proceed
anyway. Logging with pr_warn() on every one of these "benign"
mismatches creates unnecessary noise when many such modules are
loaded. Instead, handle this case with a single log warning that BTF
info may be unavailable.

Mismatches also result in calls to __btf_verifier_log() via
__btf_verifier_log_type() or btf_verifier_log_member(), adding several
additional lines of logging per mismatched module. Add checks to these
paths to skip logging for module BTF mismatches in the "allow
mismatch" case.

All existing logging behavior is preserved in the default
CONFIG_MODULE_ALLOW_BTF_MISMATCH=n case.

Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230107025331.3240536-1-connoro@google.com


Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
Bug: 260025057
Bug: 256578296
Bug: 258989318
Bug: 267715650
(cherry picked from commit 9cb61e50
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git


master)
Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
Change-Id: I2f9d19a2027610af2e825fc38fd08f56f4cd7091
(cherry picked from commit 75aa4c08)
parent 079dbbb6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment