Commit ccd2d79
bpf: Fix a potential use-after-free of BTF object
Refcounting in the check_pseudo_btf_id() function is incorrect:
the __check_pseudo_btf_id() function might get called with a zero
refcounted btf. Fix this, and patch related code accordingly.
v3: rephrase a comment (AI)
v2: fix a refcount leak introduced in v1 (AI)
Reported-by: syzbot+5a0f1995634f7c1dadbf@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=5a0f1995634f7c1dadbf
Fixes: 76145f7 ("bpf: Refactor check_pseudo_btf_id")
Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Link: https://lore.kernel.org/r/20260209132904.63908-1-a.s.protopopov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 04999b9 commit ccd2d79
1 file changed
Lines changed: 26 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21333 | 21333 | | |
21334 | 21334 | | |
21335 | 21335 | | |
21336 | | - | |
21337 | | - | |
21338 | | - | |
21339 | | - | |
| 21336 | + | |
| 21337 | + | |
| 21338 | + | |
| 21339 | + | |
21340 | 21340 | | |
21341 | 21341 | | |
21342 | 21342 | | |
21343 | 21343 | | |
| 21344 | + | |
21344 | 21345 | | |
21345 | 21346 | | |
21346 | 21347 | | |
21347 | 21348 | | |
21348 | 21349 | | |
21349 | | - | |
| 21350 | + | |
21350 | 21351 | | |
21351 | 21352 | | |
21352 | 21353 | | |
21353 | 21354 | | |
21354 | | - | |
| 21355 | + | |
| 21356 | + | |
21355 | 21357 | | |
21356 | 21358 | | |
21357 | | - | |
21358 | | - | |
21359 | 21359 | | |
21360 | 21360 | | |
21361 | 21361 | | |
| |||
21364 | 21364 | | |
21365 | 21365 | | |
21366 | 21366 | | |
21367 | | - | |
21368 | | - | |
| 21367 | + | |
| 21368 | + | |
21369 | 21369 | | |
21370 | 21370 | | |
21371 | 21371 | | |
21372 | | - | |
| 21372 | + | |
| 21373 | + | |
| 21374 | + | |
| 21375 | + | |
| 21376 | + | |
| 21377 | + | |
| 21378 | + | |
21373 | 21379 | | |
21374 | 21380 | | |
21375 | 21381 | | |
| |||
21466 | 21472 | | |
21467 | 21473 | | |
21468 | 21474 | | |
21469 | | - | |
21470 | | - | |
21471 | | - | |
| 21475 | + | |
21472 | 21476 | | |
21473 | 21477 | | |
21474 | 21478 | | |
| |||
21478 | 21482 | | |
21479 | 21483 | | |
21480 | 21484 | | |
| 21485 | + | |
21481 | 21486 | | |
21482 | 21487 | | |
21483 | 21488 | | |
21484 | 21489 | | |
21485 | | - | |
| 21490 | + | |
| 21491 | + | |
21486 | 21492 | | |
| 21493 | + | |
21487 | 21494 | | |
21488 | | - | |
21489 | | - | |
21490 | | - | |
21491 | | - | |
| 21495 | + | |
21492 | 21496 | | |
21493 | 21497 | | |
21494 | 21498 | | |
| |||
25368 | 25372 | | |
25369 | 25373 | | |
25370 | 25374 | | |
25371 | | - | |
25372 | | - | |
25373 | | - | |
25374 | | - | |
25375 | | - | |
25376 | | - | |
25377 | | - | |
| 25375 | + | |
| 25376 | + | |
| 25377 | + | |
25378 | 25378 | | |
25379 | 25379 | | |
25380 | 25380 | | |
| |||
0 commit comments