summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2026-04-18 06:19:43 +0300
committerJakub Kicinski <kuba@kernel.org>2026-04-28 03:30:28 +0300
commit51e94e1e2fef351c74d69eb53666df808d26af95 (patch)
tree16817f4d046eeeca8ac4cec98e00ffda43e8273b /include
parent01801c359a74737b9b1aa28568b60374d857241a (diff)
downloadlinux-51e94e1e2fef351c74d69eb53666df808d26af95.tar.xz
net/sched: netem: fix slot delay calculation overflow
get_slot_next() computes a random delay between min_delay and max_delay using: get_random_u32() * (max_delay - min_delay) >> 32 This overflows signed 64-bit arithmetic when the delay range exceeds approximately 2.1 seconds (2^31 nanoseconds), producing a negative result that effectively disables slot-based pacing. This is a realistic configuration for WAN emulation (e.g., slot 1s 5s). Use mul_u64_u32_shr() which handles the widening multiply without overflow. Fixes: 0a9fe5c375b5 ("netem: slotting with non-uniform distribution") Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260418032027.900913-6-stephen@networkplumber.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions