On 3/23/26 8:40 AM, Leo Yan wrote:
> ASAN reports stack-buffer-overflow due to the uninitialized op_name.
> 
> Initialize it to fix the issue.
> 
> Fixes: 054b6c7866c7 ("selftests/bpf: Add verifier log tests for BPF_BTF_LOAD 
> command")
> Signed-off-by: Leo Yan <[email protected]>
> ---
>  tools/testing/selftests/bpf/prog_tests/verifier_log.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/verifier_log.c 
> b/tools/testing/selftests/bpf/prog_tests/verifier_log.c
> index 
> aaa2854974c0a91cbbb9fc13ae0f966de1bcc818..dcbe2ef995c5b211c2b86b9555c02144e11ee7d6
>  100644
> --- a/tools/testing/selftests/bpf/prog_tests/verifier_log.c
> +++ b/tools/testing/selftests/bpf/prog_tests/verifier_log.c
> @@ -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");
> +     snprintf(op_name, sizeof(op_name), "log_fixed");

You should use strscpy() here.

This patch looks very unrelated.
Did this surface only after the changes in the makefiles?

>       ASSERT_STRNEQ(logs.buf, logs.reference, 24, op_name);
>  
>       /* validate rolling verifier log logic: try all variations of log buf
> 


Reply via email to