[Cake] [PATCH] sch_cake: avoid possible divide by zero in cake_enqueue()

David Miller davem at davemloft.net
Thu Jan 2 19:35:07 EST 2020


From: Wen Yang <wenyang at linux.alibaba.com>
Date: Thu,  2 Jan 2020 17:21:43 +0800

> The variables 'window_interval' is u64 and do_div()
> truncates it to 32 bits, which means it can test
> non-zero and be truncated to zero for division.
> The unit of window_interval is nanoseconds,
> so its lower 32-bit is relatively easy to exceed.
> Fix this issue by using div64_u64() instead.
> 
> Fixes: 7298de9cd725 ("sch_cake: Add ingress mode")
> Signed-off-by: Wen Yang <wenyang at linux.alibaba.com>

Applied and queued up for -stable.


More information about the Cake mailing list