Commit da37f93
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: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=d36d5ae81e1b0a53ef58
Fixes: aced132 ("bpf: Add range tracking for BPF_NEG")
Suggested-by: KaFai Wan <[email protected]>
Suggested-by: Eduard Zingerman <[email protected]>
Signed-off-by: Brahmajit Das <[email protected]>1 parent 5d00461 commit da37f93
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15645 | 15645 | | |
15646 | 15646 | | |
15647 | 15647 | | |
15648 | | - | |
| 15648 | + | |
| 15649 | + | |
15649 | 15650 | | |
15650 | 15651 | | |
15651 | 15652 | | |
| |||
0 commit comments