[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190930.183333.1418048214373077538.davem@davemloft.net>
Date: Mon, 30 Sep 2019 18:33:33 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: olteanv@...il.com
Cc: vinicius.gomes@...el.com, jhs@...atatu.com,
xiyou.wangcong@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net] net: sched: taprio: Fix potential integer
overflow in taprio_set_picos_per_byte
From: Vladimir Oltean <olteanv@...il.com>
Date: Sun, 29 Sep 2019 02:01:39 +0300
> The speed divisor is used in a context expecting an s64, but it is
> evaluated using 32-bit arithmetic.
>
> To avoid that happening, instead of multiplying by 1,000,000 in the
> first place, simplify the fraction and do a standard 32 bit division
> instead.
>
> Fixes: f04b514c0ce2 ("taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte")
> Reported-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> Suggested-by: Eric Dumazet <eric.dumazet@...il.com>
> Signed-off-by: Vladimir Oltean <olteanv@...il.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists