Commit 4cc7828
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")
Acked-by: Yonghong Song <[email protected]>
Acked-by: Song Liu <[email protected]>
Signed-off-by: Arnaud Lecomte <[email protected]>1 parent 4c4866c commit 4cc7828
1 file changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
254 | 255 | | |
255 | | - | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
| |||
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
| 394 | + | |
393 | 395 | | |
394 | 396 | | |
395 | | - | |
396 | | - | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | 399 | | |
403 | 400 | | |
404 | 401 | | |
| |||
409 | 406 | | |
410 | 407 | | |
411 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
0 commit comments