Skip to content
Commit 68ce6688 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller
Browse files

net: sched: taprio: Fix potential integer overflow in taprio_set_picos_per_byte



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: f04b514c ("taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte")
Reported-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Suggested-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68501df9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment