]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net/sched: sch_cake: drop WARN_ON(1) for malformed packets in ACK filter
authorToke Høiland-Jørgensen <toke@toke.dk>
Wed, 29 Jul 2026 19:14:16 +0000 (21:14 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 4 Aug 2026 01:44:20 +0000 (18:44 -0700)
The sch_cake ACK filter parses packets to find the TCP header and filter
duplicated ACKs if the flow is backlogged. The parsing code contains a
WARN_ON(1) which can be triggered by a malformed IP header in certain
cases. Depending on the system configuration, this leads either to
either spamming dmesg with warnings, or a panic if panic_on_warn is set.

The code already correctly skips the offending packet in the branch that
triggers the warning, so the WARN_ON itself doesn't really serve any
purpose. So just drop it altogether to avoid the inconvenient side
effects.

Fixes: 8b7138814f29 ("sch_cake: Add optional ACK filter")
Reported-by: Zhiling Zou <zhilinz@nebusec.ai>
Reported-by: Ren Wei <enjou1224z@gmail.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260729191417.45665-1-toke@toke.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_cake.c

index f64be54ead49b51782f368ab12802c7b4a065e22..f25f60978631a45902be13097a475df27e3f3d62 100644 (file)
@@ -1287,7 +1287,6 @@ static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
 
                        seglen = ipv6_payload_len(skb, ipv6h_check);
                } else {
-                       WARN_ON(1);  /* shouldn't happen */
                        continue;
                }