Commit 5f716ac
bpf: fix stackmap overflow check in __bpf_get_stackid()
Syzkaller reported a KASAN slab-out-of-bounds write in __bpf_get_stackid()
when copying stack trace data. The issue occurs when the perf trace
contains more stack entries than the stack map bucket can hold,
leading to an out-of-bounds write in the bucket's data array.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=c9b724fbb41cf2538b7b
Fixes: ee2a098 ("bpf: Adjust BPF stack helper functions to accommodate skip > 0")
Signed-off-by: Arnaud Lecomte <[email protected]>
Acked-by: Yonghong Song <[email protected]>1 parent 79f5f94 commit 5f716ac
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| |||
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
| 394 | + | |
| 395 | + | |
393 | 396 | | |
394 | 397 | | |
395 | | - | |
396 | | - | |
397 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
398 | 402 | | |
399 | 403 | | |
400 | | - | |
401 | | - | |
402 | 404 | | |
403 | 405 | | |
404 | 406 | | |
| |||
407 | 409 | | |
408 | 410 | | |
409 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
410 | 415 | | |
411 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
412 | 421 | | |
413 | 422 | | |
414 | 423 | | |
| |||
0 commit comments