[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ftgxl9g6.fsf@toke.dk>
Date: Fri, 03 Jan 2020 00:34:01 +0100
From: Toke Høiland-Jørgensen <toke@...e.dk>
To: Wen Yang <wenyang@...ux.alibaba.com>
Cc: Wen Yang <wenyang@...ux.alibaba.com>,
Kevin Darbyshire-Bryant <ldir@...byshire-bryant.me.uk>,
"David S . Miller" <davem@...emloft.net>,
Cong Wang <xiyou.wangcong@...il.com>,
cake@...ts.bufferbloat.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sch_cake: avoid possible divide by zero in cake_enqueue()
Wen Yang <wenyang@...ux.alibaba.com> writes:
> 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@...ux.alibaba.com>
> Cc: Kevin Darbyshire-Bryant <ldir@...byshire-bryant.me.uk>
> Cc: Toke Høiland-Jørgensen <toke@...hat.com>
> Cc: David S. Miller <davem@...emloft.net>
> Cc: Cong Wang <xiyou.wangcong@...il.com>
> Cc: cake@...ts.bufferbloat.net
> Cc: netdev@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
Acked-by: Toke Høiland-Jørgensen <toke@...e.dk>
Powered by blists - more mailing lists