Commit 35789c2
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 93f3a9b commit 35789c2
1 file changed
+16
-5
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 | | |
| 266 | + | |
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
| |||
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| 374 | + | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
| |||
390 | 393 | | |
391 | 394 | | |
392 | 395 | | |
| 396 | + | |
| 397 | + | |
393 | 398 | | |
394 | 399 | | |
395 | | - | |
396 | | - | |
397 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
398 | 404 | | |
399 | 405 | | |
400 | | - | |
401 | | - | |
402 | 406 | | |
403 | 407 | | |
404 | 408 | | |
| |||
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
410 | 417 | | |
411 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
412 | 423 | | |
413 | 424 | | |
414 | 425 | | |
| |||
0 commit comments