Commit cc8e58f
act_ife: load meta modules before tcf_idr_check_alloc()
The following deadlock scenario is triggered by syzbot:
Thread A: Thread B:
tcf_idr_check_alloc()
...
populate_metalist()
rtnl_unlock()
rtnl_lock()
...
request_module() tcf_idr_check_alloc()
rtnl_lock()
At this point, thread A is waiting for thread B to release RTNL
lock, while thread B is waiting for thread A to commit the IDR
change with tcf_idr_insert() later.
Break this deadlock situation by preloading ife modules earlier,
before tcf_idr_check_alloc(), this is fine because we only need
to load modules we need potentially.
Reported-and-tested-by: [email protected]
Fixes: 0190c1d ("net: sched: atomically check-allocate action")
Cc: Jamal Hadi Salim <[email protected]>
Cc: Vlad Buslov <[email protected]>
Cc: Jiri Pirko <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>1 parent c2b9478 commit cc8e58f
1 file changed
+34
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
439 | 458 | | |
440 | 459 | | |
441 | 460 | | |
| |||
449 | 468 | | |
450 | 469 | | |
451 | 470 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | 471 | | |
457 | 472 | | |
458 | 473 | | |
| |||
509 | 524 | | |
510 | 525 | | |
511 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
512 | 542 | | |
513 | 543 | | |
514 | 544 | | |
| |||
570 | 600 | | |
571 | 601 | | |
572 | 602 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | 603 | | |
579 | 604 | | |
580 | 605 | | |
581 | | - | |
582 | 606 | | |
583 | 607 | | |
584 | 608 | | |
| |||
0 commit comments