Commit 5c697e0
committed
sch_htb: make htb_deactivate() idempotent
jira LE-3845
cve CVE-2025-38350
Rebuild_History Non-Buildable kernel-4.18.0-553.69.1.el8_10
commit-author Cong Wang <[email protected]>
commit 3769478
Alan reported a NULL pointer dereference in htb_next_rb_node()
after we made htb_qlen_notify() idempotent.
It turns out in the following case it introduced some regression:
htb_dequeue_tree():
|-> fq_codel_dequeue()
|-> qdisc_tree_reduce_backlog()
|-> htb_qlen_notify()
|-> htb_deactivate()
|-> htb_next_rb_node()
|-> htb_deactivate()
For htb_next_rb_node(), after calling the 1st htb_deactivate(), the
clprio[prio]->ptr could be already set to NULL, which means
htb_next_rb_node() is vulnerable here.
For htb_deactivate(), although we checked qlen before calling it, in
case of qlen==0 after qdisc_tree_reduce_backlog(), we may call it again
which triggers the warning inside.
To fix the issues here, we need to:
1) Make htb_deactivate() idempotent, that is, simply return if we
already call it before.
2) Make htb_next_rb_node() safe against ptr==NULL.
Many thanks to Alan for testing and for the reproducer.
Fixes: 5ba8b83 ("sch_htb: make htb_qlen_notify() idempotent")
Reported-by: Alan J. Wylie <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
(cherry picked from commit 3769478)
Signed-off-by: Jonathan Maple <[email protected]>1 parent 08ce88f commit 5c697e0
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
| 357 | + | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
| |||
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | | - | |
618 | | - | |
| 618 | + | |
| 619 | + | |
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
| |||
1753 | 1754 | | |
1754 | 1755 | | |
1755 | 1756 | | |
1756 | | - | |
1757 | | - | |
| 1757 | + | |
1758 | 1758 | | |
1759 | 1759 | | |
1760 | 1760 | | |
| |||
1970 | 1970 | | |
1971 | 1971 | | |
1972 | 1972 | | |
1973 | | - | |
1974 | | - | |
| 1973 | + | |
1975 | 1974 | | |
1976 | 1975 | | |
1977 | 1976 | | |
| |||
0 commit comments