Re: [PATCH net v2] net/sched: cake: reject overhead values that underflow length
From: Jakub Kicinski
Date: Sat Jun 13 2026 - 17:26:46 EST
On Tue, 9 Jun 2026 23:29:36 +0000 Samuel Moelius wrote:
> +static const struct netlink_range_validation_signed cake_overhead_range = {
> + .min = -64,
> + .max = 256,
Both Sashiko's complain - these values are neither safe nor sufficient.
How was the -64 chosen? It looks suspiciously close the min ethernet
frame length. But in that case (a) FCS doesn't count so 60, and
(b) even IPv4 TCP packets can be shorter (at qdisc layer) than 64B
leading to underflow...
I see min rate in cake is 64 but I don't see any other meaning of the
64 literal.
Toke, WDYT? Should we use a smaller constant (ETH_HLEN?) or do the
check on the datapath?
Also - small constants fit directly in nla_policy, you don't need
struct netlink_range_validation_signed
--
pw-bot: cr