summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf_utils.c
diff options
context:
space:
mode:
authorBrahmajit Das <listout@listout.xyz>2025-10-02 00:47:38 +0530
committerAlexei Starovoitov <ast@kernel.org>2025-10-01 13:53:20 -0700
commit34904582b502a86fdb4d7984b12cacd2faabbe0d (patch)
tree9d40b880dfbbea996dca87a6babae2fb02dad942 /tools/lib/bpf/libbpf_utils.c
parent0c342bfc9949dffeaa83ebdde3b4b0ce59009348 (diff)
bpf: Skip scalar adjustment for BPF_NEG if dst is a pointer
In check_alu_op(), the verifier currently calls check_reg_arg() and adjust_scalar_min_max_vals() unconditionally for BPF_NEG operations. However, if the destination register holds a pointer, these scalar adjustments are unnecessary and potentially incorrect. This patch adds a check to skip the adjustment logic when the destination register contains a pointer. Reported-by: syzbot+d36d5ae81e1b0a53ef58@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=d36d5ae81e1b0a53ef58 Fixes: aced132599b3 ("bpf: Add range tracking for BPF_NEG") Suggested-by: KaFai Wan <kafai.wan@linux.dev> Suggested-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Brahmajit Das <listout@listout.xyz> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20251001191739.2323644-2-listout@listout.xyz Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf_utils.c')
0 files changed, 0 insertions, 0 deletions