Commit db06c29
net/sched: sch_cake: Fix incorrect qlen reduction in cake_drop
jira VULN-186699
cve CVE-2025-68325
commit-author Xiang Mei <xmei5@asu.edu>
commit 9fefc78
upstream-diff |
In this kernel, cake_drop() has the qdisc_tree_reduce_backlog() call
before __qdisc_drop()/sch->q.qlen-- rather than after. The upstream
patch context for that hunk did not match, so the removal of
qdisc_tree_reduce_backlog() from cake_drop() was manually applied.
Functionally identical to upstream. Matches the 5.15 stable backport
(commit 38abf6e931b1).
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: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>1 parent 7efae41 commit db06c29
1 file changed
Lines changed: 32 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1539 | 1539 | | |
1540 | 1540 | | |
1541 | 1541 | | |
1542 | | - | |
1543 | 1542 | | |
1544 | 1543 | | |
1545 | 1544 | | |
| |||
1695 | 1694 | | |
1696 | 1695 | | |
1697 | 1696 | | |
| 1697 | + | |
1698 | 1698 | | |
1699 | | - | |
1700 | | - | |
| 1699 | + | |
1701 | 1700 | | |
1702 | 1701 | | |
1703 | 1702 | | |
1704 | 1703 | | |
1705 | | - | |
| 1704 | + | |
1706 | 1705 | | |
1707 | 1706 | | |
1708 | 1707 | | |
| |||
1775 | 1774 | | |
1776 | 1775 | | |
1777 | 1776 | | |
| 1777 | + | |
| 1778 | + | |
1778 | 1779 | | |
1779 | 1780 | | |
1780 | 1781 | | |
| |||
1785 | 1786 | | |
1786 | 1787 | | |
1787 | 1788 | | |
1788 | | - | |
1789 | | - | |
| 1789 | + | |
| 1790 | + | |
1790 | 1791 | | |
1791 | 1792 | | |
1792 | 1793 | | |
1793 | 1794 | | |
1794 | | - | |
| 1795 | + | |
1795 | 1796 | | |
1796 | 1797 | | |
1797 | 1798 | | |
| |||
1800 | 1801 | | |
1801 | 1802 | | |
1802 | 1803 | | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
1808 | 1809 | | |
1809 | 1810 | | |
1810 | 1811 | | |
| |||
1897 | 1898 | | |
1898 | 1899 | | |
1899 | 1900 | | |
1900 | | - | |
1901 | | - | |
1902 | | - | |
1903 | | - | |
| 1901 | + | |
| 1902 | + | |
1904 | 1903 | | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
| 1904 | + | |
| 1905 | + | |
1908 | 1906 | | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
1914 | 1917 | | |
1915 | | - | |
1916 | | - | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
1917 | 1922 | | |
| 1923 | + | |
1918 | 1924 | | |
1919 | 1925 | | |
1920 | 1926 | | |
| |||
0 commit comments