Commit c275a17
can: raw: add missing refcount for memory leak fix
Commit ee8b94c ("can: raw: fix receiver memory leak") introduced
a new reference to the CAN netdevice that has assigned CAN filters.
But this new ro->dev reference did not maintain its own refcount which
lead to another KASAN use-after-free splat found by Eric Dumazet.
This patch ensures a proper refcount for the CAN nedevice.
Fixes: ee8b94c ("can: raw: fix receiver memory leak")
Reported-by: Eric Dumazet <edumazet@google.com>
Cc: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/r/20230821144547.6658-3-socketcan@hartkopp.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 0bfe711 commit c275a17
1 file changed
Lines changed: 26 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | | - | |
| 289 | + | |
289 | 290 | | |
| 291 | + | |
| 292 | + | |
290 | 293 | | |
291 | 294 | | |
292 | 295 | | |
| |||
391 | 394 | | |
392 | 395 | | |
393 | 396 | | |
394 | | - | |
| 397 | + | |
395 | 398 | | |
396 | | - | |
| 399 | + | |
| 400 | + | |
397 | 401 | | |
| 402 | + | |
398 | 403 | | |
399 | 404 | | |
400 | 405 | | |
| |||
445 | 450 | | |
446 | 451 | | |
447 | 452 | | |
448 | | - | |
449 | 453 | | |
450 | | - | |
| 454 | + | |
451 | 455 | | |
| 456 | + | |
452 | 457 | | |
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
459 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
460 | 467 | | |
461 | 468 | | |
462 | 469 | | |
| |||
467 | 474 | | |
468 | 475 | | |
469 | 476 | | |
470 | | - | |
| 477 | + | |
471 | 478 | | |
472 | 479 | | |
473 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
474 | 483 | | |
| 484 | + | |
475 | 485 | | |
476 | 486 | | |
477 | 487 | | |
| 488 | + | |
478 | 489 | | |
| 490 | + | |
| 491 | + | |
479 | 492 | | |
480 | 493 | | |
481 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
482 | 499 | | |
483 | 500 | | |
484 | 501 | | |
| |||
0 commit comments