bpf: change WARN ro pr_warn in verifier in 5.10 kernels

Message ID 20240221100323.861959-1-oficerovas@altlinux.org
State New
Headers
Series bpf: change WARN ro pr_warn in verifier in 5.10 kernels |

Commit Message

Alexander Ofitserov Feb. 21, 2024, 10:03 a.m. UTC
  Change WARN to pr_warn in check_map_prog_compatibility,
because this functionality was added in kernels 6.1 and
because fuzzing kernels with syzkaller while
kernel was started with parameter panic_on_warn
produces false positive crashes.

Signed-off-by: Alexander Ofitserov <oficerovas@altlinux.org>
Cc: stable@vger.kernel.org
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 45c50ee9b0370..7a7a6e3087ba2 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -10478,7 +10478,7 @@  static int check_map_prog_compatibility(struct bpf_verifier_env *env,
 			verbose(env, "trace type programs can only use preallocated hash map\n");
 			return -EINVAL;
 		}
-		WARN_ONCE(1, "trace type BPF program uses run-time allocation\n");
+		pr_warn_once("trace type BPF program uses run-time allocation\n");
 		verbose(env, "trace type programs with run-time allocated hash maps are unsafe. Switch to preallocated hash maps.\n");
 	}