mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
selftests/bpf: Initialize operation name before use
ASAN reports stack-buffer-overflow due to the uninitialized op_name.
Initialize it to fix the issue.
Fixes: 054b6c7866 ("selftests/bpf: Add verifier log tests for BPF_BTF_LOAD command")
Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-6-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
b40ba13937
commit
55ffbe8a15
|
|
@ -317,6 +317,7 @@ static void verif_btf_log_subtest(bool bad_btf)
|
|||
res = load_btf(&opts, true);
|
||||
ASSERT_EQ(res, -ENOSPC, "half_log_fd");
|
||||
ASSERT_EQ(strlen(logs.buf), 24, "log_fixed_25");
|
||||
strscpy(op_name, "log_fixed", sizeof(op_name));
|
||||
ASSERT_STRNEQ(logs.buf, logs.reference, 24, op_name);
|
||||
|
||||
/* validate rolling verifier log logic: try all variations of log buf
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user