Commit 02aa6f4
committed
net/sched: sch_cake: Fix incorrect qlen reduction in cake_drop
jira VULN-187517
cve CVE-2025-68325
commit-author Xiang Mei <xmei5@asu.edu>
commit 9fefc78
In cake_drop(), qdisc_tree_reduce_backlog() is used to update the qlen
and backlog of the qdisc hierarchy. Its caller, cake_enqueue(), assumes
that the parent qdisc will enqueue the current packet. However, this
assumption breaks when cake_enqueue() returns NET_XMIT_CN: the parent
qdisc stops enqueuing current packet, leaving the tree qlen/backlog
accounting inconsistent. This mismatch can lead to a NULL dereference
(e.g., when the parent Qdisc is qfq_qdisc).
This patch computes the qlen/backlog delta in a more robust way by
observing the difference before and after the series of cake_drop()
calls, and then compensates the qdisc tree accounting if cake_enqueue()
returns NET_XMIT_CN.
To ensure correct compensation when ACK thinning is enabled, a new
variable is introduced to keep qlen unchanged.
Fixes: 15de71d ("net/sched: Make cake_enqueue return NET_XMIT_CN when past buffer_limit")
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Reviewed-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20251128001415.377823-1-xmei5@asu.edu
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 9fefc78)
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>1 parent 195e5dc commit 02aa6f4
1 file changed
Lines changed: 32 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1548 | 1548 | | |
1549 | 1549 | | |
1550 | 1550 | | |
1551 | | - | |
1552 | 1551 | | |
1553 | 1552 | | |
1554 | 1553 | | |
| |||
1694 | 1693 | | |
1695 | 1694 | | |
1696 | 1695 | | |
| 1696 | + | |
1697 | 1697 | | |
1698 | | - | |
1699 | | - | |
| 1698 | + | |
1700 | 1699 | | |
1701 | 1700 | | |
1702 | 1701 | | |
1703 | 1702 | | |
1704 | | - | |
| 1703 | + | |
1705 | 1704 | | |
1706 | 1705 | | |
1707 | 1706 | | |
| |||
1774 | 1773 | | |
1775 | 1774 | | |
1776 | 1775 | | |
| 1776 | + | |
| 1777 | + | |
1777 | 1778 | | |
1778 | 1779 | | |
1779 | 1780 | | |
| |||
1784 | 1785 | | |
1785 | 1786 | | |
1786 | 1787 | | |
1787 | | - | |
1788 | | - | |
| 1788 | + | |
| 1789 | + | |
1789 | 1790 | | |
1790 | 1791 | | |
1791 | 1792 | | |
1792 | 1793 | | |
1793 | | - | |
| 1794 | + | |
1794 | 1795 | | |
1795 | 1796 | | |
1796 | 1797 | | |
| |||
1799 | 1800 | | |
1800 | 1801 | | |
1801 | 1802 | | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
1807 | 1808 | | |
1808 | 1809 | | |
1809 | 1810 | | |
| |||
1896 | 1897 | | |
1897 | 1898 | | |
1898 | 1899 | | |
1899 | | - | |
1900 | | - | |
1901 | | - | |
1902 | | - | |
| 1900 | + | |
| 1901 | + | |
1903 | 1902 | | |
1904 | | - | |
1905 | | - | |
1906 | | - | |
| 1903 | + | |
| 1904 | + | |
1907 | 1905 | | |
1908 | | - | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
1913 | 1916 | | |
1914 | | - | |
1915 | | - | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
1916 | 1921 | | |
| 1922 | + | |
1917 | 1923 | | |
1918 | 1924 | | |
1919 | 1925 | | |
| |||
0 commit comments