]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/sched: netem: check for negative latency and jitter
authorStephen Hemminger <stephen@networkplumber.org>
Sat, 18 Apr 2026 03:19:44 +0000 (20:19 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Apr 2026 00:30:28 +0000 (17:30 -0700)
commit90be9fedb218ee95a1cf59050d1306fbfb0e8b87
tree85ac0e5c2330d9337bad230189b7ae3335c4b022
parent51e94e1e2fef351c74d69eb53666df808d26af95
net/sched: netem: check for negative latency and jitter

Reject requests with negative latency or jitter.
A negative value added to current timestamp (u64) wraps
to an enormous time_to_send, disabling dequeue.
The original UAPI used u32 for these values; the conversion to 64-bit
time values via TCA_NETEM_LATENCY64 and TCA_NETEM_JITTER64
allowed signed values to reach the kernel without validation.

Jitter is already silently clamped by an abs() in netem_change();
that abs() can be removed in a follow-up once this rejection is in
place.

Fixes: 99803171ef04 ("netem: add uapi to express delay and jitter in nanoseconds")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260418032027.900913-7-stephen@networkplumber.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_netem.c