Commit c1bf840
committed
net/sched: sch_qfq: Fix race condition on qfq_aggregate
jira VULN-89290
jira VULN-89289
cve CVE-2025-38477
commit-author Xiang Mei <xmei5@asu.edu>
commit 5e28d5a
A race condition can occur when 'agg' is modified in qfq_change_agg
(called during qfq_enqueue) while other threads access it
concurrently. For example, qfq_dump_class may trigger a NULL
dereference, and qfq_delete_class may cause a use-after-free.
This patch addresses the issue by:
1. Moved qfq_destroy_class into the critical section.
2. Added sch_tree_lock protection to qfq_dump_class and
qfq_dump_class_stats.
Fixes: 462dbc9 ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost")
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5e28d5a)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent 325a6c5 commit c1bf840
1 file changed
+21
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
453 | 457 | | |
454 | | - | |
| 458 | + | |
455 | 459 | | |
456 | 460 | | |
457 | 461 | | |
| |||
554 | 558 | | |
555 | 559 | | |
556 | 560 | | |
| 561 | + | |
557 | 562 | | |
558 | 563 | | |
559 | 564 | | |
560 | | - | |
561 | 565 | | |
562 | 566 | | |
563 | 567 | | |
| |||
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
| 631 | + | |
627 | 632 | | |
628 | 633 | | |
629 | 634 | | |
| |||
632 | 637 | | |
633 | 638 | | |
634 | 639 | | |
635 | | - | |
636 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
637 | 647 | | |
638 | 648 | | |
639 | 649 | | |
| |||
650 | 660 | | |
651 | 661 | | |
652 | 662 | | |
| 663 | + | |
653 | 664 | | |
654 | 665 | | |
| 666 | + | |
655 | 667 | | |
656 | 668 | | |
657 | 669 | | |
| |||
0 commit comments