Thread (3 messages) 3 messages, 3 authors, 10d ago

Re: [PATCH v3] net/sched: cake: reject overhead values that underflow length

From: Toke Høiland-Jørgensen <toke@toke.dk>
Date: 2026-07-02 09:40:35
Also in: lkml

Samuel Moelius [off-list ref] writes:
CAKE accepts signed overhead values and stores them in an s16, but the
adjusted packet length calculation uses unsigned arithmetic.  A negative
effective length can therefore wrap to a large value.

Such configurations make rate accounting depend on integer wraparound
rather than on the packet size userspace intended to model.  A static
netlink lower bound is not enough because packets reaching CAKE can be
smaller than any reasonable manual-overhead allowance.

Fold the signed overhead adjustment into the existing datapath MPU clamp
so negative adjusted lengths are clamped before link-layer framing
adjustments.

Fixes: a729b7f0bd5b ("sch_cake: Add overhead compensation support to the rate shaper")
Assisted-by: Codex:gpt-5.5-cyber-preview
Signed-off-by: Samuel Moelius <redacted>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help