Commit bd21000
bpf: verifier: fix WARNING in reg_bounds_sanity_check (2)
syzbot reported a "REG INVARIANTS VIOLATION" triggered in reg_bounds_sanity_check()
due to inconsistent umin/umax and var_off state after min/max updates.
reg_set_min_max() and adjust_reg_min_max_vals() could leave a register state
partially updated before syncing the bounds, causing verifier_bug() to fire.
This patch ensures reg_bounds_sync() is called after updates, and additionally
marks registers unbounded if min/max values are inconsistent, so that umin/umax,
smin/smax, and var_off remain consistent.
Fixes: d69eb20 ("Merge tag 'net-6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=c950cc277150935cc0b5
Signed-off-by: Kriish Sharma <[email protected]>1 parent 0f635c7 commit bd21000
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16318 | 16318 | | |
16319 | 16319 | | |
16320 | 16320 | | |
| 16321 | + | |
| 16322 | + | |
| 16323 | + | |
| 16324 | + | |
| 16325 | + | |
| 16326 | + | |
| 16327 | + | |
| 16328 | + | |
| 16329 | + | |
| 16330 | + | |
| 16331 | + | |
| 16332 | + | |
| 16333 | + | |
16321 | 16334 | | |
16322 | 16335 | | |
16323 | 16336 | | |
| |||
16344 | 16357 | | |
16345 | 16358 | | |
16346 | 16359 | | |
| 16360 | + | |
| 16361 | + | |
16347 | 16362 | | |
16348 | 16363 | | |
16349 | 16364 | | |
16350 | 16365 | | |
16351 | 16366 | | |
| 16367 | + | |
| 16368 | + | |
16352 | 16369 | | |
16353 | 16370 | | |
16354 | 16371 | | |
| |||
0 commit comments