Skip to contentSkip to conversation

netem: bug fixes

PATCH Applied Stephen Hemminger 5 participants 16 messages Apr 18 – Apr 28

Subsystems (4)
lore
Share & tools
lore

Stephen Hemminger

author maintainer
#0 lore raw

v8 cover netem: bug fixes

These bugs were found when doing AI-assisted review of sch_netem.c during investigation of the packet duplication recursion problem addressed in Jamal's series.

The fixes cover:

- probability gaps in the 4-state Markov loss model
- queue limit not accounting for reordered packets
- PRNG reseeded on every tc change, breaking reproducibility
- slot configuration not validated (inverted ranges, negative delays, negative limits)
- slot delay arithmetic overflow for ranges above ~2.1 seconds
- negative latency and jitter wrapping to huge time_to_send values via u64 arithmetic

v8 - added check for negative TCA_NETEM_LATENCY64 and TCA_NETEM_JITTER64
- extended slot validation to cover dist_delay, dist_jitter, max_packets and max_bytes

Stephen Hemminger (6):
net/sched: netem: fix probability gaps in 4-state loss model net/sched: netem: fix queue limit check to include reordered packets net/sched: netem: only reseed PRNG when seed is explicitly provided net/sched: netem: validate slot configuration
net/sched: netem: fix slot delay calculation overflow net/sched: netem: check for negative latency and jitter

 net/sched/sch_netem.c | 76 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 64 insertions(+), 12 deletions(-)
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH v8 1/6 net/sched: netem: fix probability gaps in 4-state loss model

The 4-state Markov chain in loss_4state() has gaps at the boundaries between transition probability ranges. The comparisons use:

  if (rnd < a4)
  else if (a4 < rnd && rnd < a1 + a4)

When rnd equals a boundary value exactly, neither branch matches and no state transition occurs. The redundant lower-bound check (a4 < rnd) is already implied by being in the else branch.

Remove the unnecessary lower-bound comparisons so the ranges are contiguous and every random value produces a transition, matching the GI (General and Intuitive) loss model specification.

This bug goes back to original implementation of this model.

Fixes 661b79725fea ("netem: revised correlated loss generator")
---
 net/sched/sch_netem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/sched/sch_netem.c +4 -4
index 20df1c08b1e9..8ee72cac1faf 100644
@@ -227,10 +227,10 @@ static bool loss_4state(struct netem_sched_data *q)
 		if (rnd < clg->a4) {
 			clg->state = LOST_IN_GAP_PERIOD;
 			return true;
-		} else if (clg->a4 < rnd && rnd < clg->a1 + clg->a4) {
+		} else if (rnd < clg->a1 + clg->a4) {
 			clg->state = LOST_IN_BURST_PERIOD;
 			return true;
-		} else if (clg->a1 + clg->a4 < rnd) {
+		} else {
 			clg->state = TX_IN_GAP_PERIOD;
 		}
 
@@ -247,9 +247,9 @@ static bool loss_4state(struct netem_sched_data *q)
 	case LOST_IN_BURST_PERIOD:
 		if (rnd < clg->a3)
 			clg->state = TX_IN_BURST_PERIOD;
-		else if (clg->a3 < rnd && rnd < clg->a2 + clg->a3) {
+		else if (rnd < clg->a2 + clg->a3) {
 			clg->state = TX_IN_GAP_PERIOD;
-		} else if (clg->a2 + clg->a3 < rnd) {
+		} else {
 			clg->state = LOST_IN_BURST_PERIOD;
 			return true;
 		}
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH v8 2/6 net/sched: netem: fix queue limit check to include reordered packets

In reply to Stephen Hemminger

The queue limit check in netem_enqueue() uses q->t_len which only counts packets in the internal tfifo. Packets placed in sch->q by the reorder path (__qdisc_enqueue_head) are not counted, allowing the total queue occupancy to exceed sch->limit under reordering.

Include sch->q.qlen in the limit check.

Fixes f8d4bc455047 ("net/sched: netem: account for backlog updates from child qdisc")
---
 net/sched/sch_netem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_netem.c +1 -1
index 8ee72cac1faf..d400a730eadd 100644
@@ -524,7 +524,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 				1 << get_random_u32_below(8);
 	}
 
-	if (unlikely(q->t_len >= sch->limit)) {
+	if (unlikely(sch->q.qlen >= sch->limit)) {
 		/* re-link segs, so that qdisc_drop_all() frees them all */
 		skb->next = segs;
 		qdisc_drop_all(skb, sch, to_free);
Signature · 1 line
2.53.0
reviewer
#3 lore raw

Re: [PATCH net v8 2/6] net/sched: netem: fix queue limit check to include reordered packets

Quoted 10 lines · Stephen Hemminger

The queue limit check in netem_enqueue() uses q->t_len which only counts packets in the internal tfifo. Packets placed in sch->q by the reorder path (__qdisc_enqueue_head) are not counted, allowing the total queue occupancy to exceed sch->limit under reordering.

Include sch->q.qlen in the limit check.

Fixes f8d4bc455047 ("net/sched: netem: account for backlog updates from child qdisc")

I acknowledge that Sashiko has provided review of this patch.

In the case of the commentary on the use of sch->q.qlen in place of q->t_len:
this is exactly the intention of this patch; to address shortcomings in commit f8d4bc455047. Follow-up issues can be treated as such.

In the case of feedback on us of qdisc_drop_all(): if this is a problem then it predates this patch and can be addressed separately to this patch-set.

...

author maintainer
#4 lore raw

PATCH v8 3/6 net/sched: netem: only reseed PRNG when seed is explicitly provided

In reply to Stephen Hemminger

netem_change() unconditionally reseeds the PRNG on every tc change command. If TCA_NETEM_PRNG_SEED is not specified, a new random seed is generated, destroying reproducibility for users who set a deterministic seed on a previous change.

Move the initial random seed generation to netem_init() and only reseed in netem_change() when TCA_NETEM_PRNG_SEED is explicitly provided by the user.

Fixes 4072d97ddc44 ("netem: add prng attribute to netem_sched_data")
---
 net/sched/sch_netem.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/sched/sch_netem.c +6 -4
index d400a730eadd..556f9747f0e7 100644
@@ -1112,11 +1112,10 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt,
 	/* capping jitter to the range acceptable by tabledist() */
 	q->jitter = min_t(s64, abs(q->jitter), INT_MAX);
 
-	if (tb[TCA_NETEM_PRNG_SEED])
+	if (tb[TCA_NETEM_PRNG_SEED]) {
 		q->prng.seed = nla_get_u64(tb[TCA_NETEM_PRNG_SEED]);
-	else
-		q->prng.seed = get_random_u64();
-	prandom_seed_state(&q->prng.prng_state, q->prng.seed);
+		prandom_seed_state(&q->prng.prng_state, q->prng.seed);
+	}
 
 unlock:
 	sch_tree_unlock(sch);
@@ -1139,6 +1138,9 @@ static int netem_init(struct Qdisc *sch, struct nlattr *opt,
 		return -EINVAL;
 
 	q->loss_model = CLG_RANDOM;
+	q->prng.seed = get_random_u64();
+	prandom_seed_state(&q->prng.prng_state, q->prng.seed);
+
 	ret = netem_change(sch, opt, extack);
 	if (ret)
 		pr_info("netem: change failed\n");
Signature · 1 line
2.53.0
author maintainer
#5 lore raw

PATCH v8 4/6 net/sched: netem: validate slot configuration

In reply to Stephen Hemminger

Reject slot configurations that have no defensible meaning:

- negative min_delay or max_delay
- min_delay greater than max_delay
- negative dist_delay or dist_jitter
- negative max_packets or max_bytes

Negative or out-of-order delays underflow in get_slot_next(), producing garbage intervals. Negative limits trip the per-slot accounting (packets_left/bytes_left <= 0) on the first packet of every slot, defeating the rate-limiting half of the slot feature.

Note that dist_jitter has been silently coerced to its absolute value by get_slot() since the feature was introduced; rejecting negatives here converts that silent coercion into -EINVAL. The abs() can be removed in a follow-up.

Fixes 836af83b54e3 ("netem: support delivering packets in delayed time slots")
---
 net/sched/sch_netem.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
net/sched/sch_netem.c +29 -0
index 556f9747f0e7..640b51be807a 100644
@@ -827,6 +827,29 @@ static int get_dist_table(struct disttable **tbl, const struct nlattr *attr)
 	return 0;
 }
 
+static int validate_slot(const struct nlattr *attr, struct netlink_ext_ack *extack)
+{
+	const struct tc_netem_slot *c = nla_data(attr);
+
+	if (c->min_delay < 0 || c->max_delay < 0) {
+		NL_SET_ERR_MSG_ATTR(extack, attr, "negative slot delay");
+		return -EINVAL;
+	}
+	if (c->min_delay > c->max_delay) {
+		NL_SET_ERR_MSG_ATTR(extack, attr, "slot min delay greater than max delay");
+		return -EINVAL;
+	}
+	if (c->dist_delay < 0 || c->dist_jitter < 0) {
+		NL_SET_ERR_MSG_ATTR(extack, attr, "negative dist delay");
+		return -EINVAL;
+	}
+	if (c->max_packets < 0 || c->max_bytes < 0) {
+		NL_SET_ERR_MSG_ATTR(extack, attr, "negative slot limit");
+		return -EINVAL;
+	}
+	return 0;
+}
+
 static void get_slot(struct netem_sched_data *q, const struct nlattr *attr)
 {
 	const struct tc_netem_slot *c = nla_data(attr);
@@ -1040,6 +1063,12 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt,
 			goto table_free;
 	}
 
+	if (tb[TCA_NETEM_SLOT]) {
+		ret = validate_slot(tb[TCA_NETEM_SLOT], extack);
+		if (ret)
+			goto table_free;
+	}
+
 	sch_tree_lock(sch);
 	/* backup q->clg and q->loss_model */
 	old_clg = q->clg;
Signature · 1 line
2.53.0
reviewer Reviewed-by on v8 4/6
#6 lore raw

Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration

Quoted 12 lines · Stephen Hemminger

Reject slot configurations that have no defensible meaning:

- negative min_delay or max_delay
- min_delay greater than max_delay
- negative dist_delay or dist_jitter
- negative max_packets or max_bytes

Negative or out-of-order delays underflow in get_slot_next(), producing garbage intervals. Negative limits trip the per-slot accounting (packets_left/bytes_left <= 0) on the first packet of every slot, defeating the rate-limiting half of the slot feature.

Quoted 7 lines

Note that dist_jitter has been silently coerced to its absolute value by get_slot() since the feature was introduced; rejecting negatives here converts that silent coercion into -EINVAL. The abs() can be removed in a follow-up.

Fixes 836af83b54e3 ("netem: support delivering packets in delayed time slots")

I acknowledge that Sashiko has provided feedback on this patch.

1. "Does rejecting negative dist_jitter values with -EINVAL cause a regression in userspace ABI backward compatibility? Since the kernel previously accepted these values and silently coerced them using abs(), existing userspace tools or scripts that happen to pass negative values might start failing to configure the qdisc."

This is intended and explicitly explained in the cover letter.

2. "Could directly dereferencing 64-bit fields from the netlink attribute payload cause undefined behavior on strict-alignment architectures? Netlink attribute payloads are typically only guaranteed to be 4-byte aligned because NLA_ALIGNTO is 4, but the __s64 fields within tc_netem_slot like min_delay require 8-byte natural alignment. Performing an 8-byte read from a potentially 4-byte aligned address might cause an alignment fault on certain architectures."

This patch does not change the presence of this problem; and I suspect it is not a problem at all.

maintainer
#7 lore raw

Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration

Quoted 25 lines · Simon Horman
Quoted 12 lines · Stephen Hemminger

Reject slot configurations that have no defensible meaning:

- negative min_delay or max_delay
- min_delay greater than max_delay
- negative dist_delay or dist_jitter
- negative max_packets or max_bytes

Negative or out-of-order delays underflow in get_slot_next(), producing garbage intervals. Negative limits trip the per-slot accounting (packets_left/bytes_left <= 0) on the first packet of every slot, defeating the rate-limiting half of the slot feature.

Quoted 7 lines

Note that dist_jitter has been silently coerced to its absolute value by get_slot() since the feature was introduced; rejecting negatives here converts that silent coercion into -EINVAL. The abs() can be removed in a follow-up.

Fixes 836af83b54e3 ("netem: support delivering packets in delayed time slots")

I acknowledge that Sashiko has provided feedback on this patch.

Quoted 7 lines

1. "Does rejecting negative dist_jitter values with -EINVAL cause a regression in userspace ABI backward compatibility? Since the kernel previously accepted these values and silently coerced them using abs(), existing userspace tools or scripts that happen to pass negative values might start failing to configure the qdisc."

This is intended and explicitly explained in the cover letter.

Jamal, given the uAPI implication, could you please double check that the change is fine?

Thanks,

Paolo

maintainer
#8 lore raw

Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration

Quoted 33 lines · Paolo Abeni
Quoted 31 lines · Simon Horman
Quoted 12 lines · Stephen Hemminger

Reject slot configurations that have no defensible meaning:

- negative min_delay or max_delay
- min_delay greater than max_delay
- negative dist_delay or dist_jitter
- negative max_packets or max_bytes

Negative or out-of-order delays underflow in get_slot_next(), producing garbage intervals. Negative limits trip the per-slot accounting (packets_left/bytes_left <= 0) on the first packet of every slot, defeating the rate-limiting half of the slot feature.

Quoted 7 lines

Note that dist_jitter has been silently coerced to its absolute value by get_slot() since the feature was introduced; rejecting negatives here converts that silent coercion into -EINVAL. The abs() can be removed in a follow-up.

Fixes 836af83b54e3 ("netem: support delivering packets in delayed time slots")

I acknowledge that Sashiko has provided feedback on this patch.

1. "Does rejecting negative dist_jitter values with -EINVAL cause a regression in userspace ABI backward compatibility? Since the kernel previously accepted these values and silently coerced them using abs(), existing userspace tools or scripts that happen to pass negative values might start failing to configure the qdisc."

Quoted 4 lines
Quoted 1 line

This is intended and explicitly explained in the cover letter.

Jamal, given the uAPI implication, could you please double check that the change is fine?

It should be fine; at least iproute2 will never allow the kernel to receive a negative number.
Stephen brought up the fact that strtod() could return a -ve number (but at least iproute2 makes sure negative numbers are not carried forward to the kernel).

cheers,
jamal

Quoted 4 lines

Thanks,

Paolo

author maintainer
#9 lore raw

Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration

Quoted 5 lines · On Thu, 23 Apr 2026 17:12:15 -0400 Jamal Hadi Salim <[email protected]> wrote:
Quoted 4 lines
Quoted 1 line

This is intended and explicitly explained in the cover letter.

Jamal, given the uAPI implication, could you please double check that the change is fine?

Quoted 8 lines

It should be fine; at least iproute2 will never allow the kernel to receive a negative number.
Stephen brought up the fact that strtod() could return a -ve number (but at least iproute2 makes sure negative numbers are not carried forward to the kernel).

cheers,
jamal

Iproute2 blocks negative values kind of by accident.
The NEXT_IS_NUMBER() macro looks for digit at start of arg. To hit this you need to either use raw netlink or change NEXT_IS_NUMBER() to NEXT_IS_SIGNED_NUMBER() where slot values are parsed.

maintainer
#10 lore raw

Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration

() ncalls s

Quoted 15 lines · Stephen Hemminger
Quoted 11 lines · On Thu, 23 Apr 2026 17:12:15 -0400 Jamal Hadi Salim <[email protected]> wrote:
Quoted 4 lines
Quoted 1 line

This is intended and explicitly explained in the cover letter.

Jamal, given the uAPI implication, could you please double check that the change is fine?

It should be fine; at least iproute2 will never allow the kernel to receive a negative number.
Stephen brought up the fact that strtod() could return a -ve number (but at least iproute2 makes sure negative numbers are not carried forward to the kernel).

Quoted 7 lines
Quoted 2 lines

cheers,
jamal

Iproute2 blocks negative values kind of by accident.
The NEXT_IS_NUMBER() macro looks for digit at start of arg. To hit this you need to either use raw netlink or change NEXT_IS_NUMBER() to NEXT_IS_SIGNED_NUMBER() where slot values are parsed.

For this specific attribute it was intentional:
...
if (get_time64(&slot.dist_jitter, *argv)) { //get_time64 calls strtod() which could set dist_jitter -ve

    explain1("slot jitter");
     return -1;
}
if (slot.dist_jitter <= 0) {  // we reject -ve values
    fprintf(stderr, "Non-positive jitter\n");
    return -1;
}

cheers,
jamal

author maintainer
#11 lore raw

Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration

Quoted 40 lines · On Fri, 24 Apr 2026 16:17:13 -0400 Jamal Hadi Salim <[email protected]> wrote:

() ncalls s

Quoted 15 lines · Stephen Hemminger
Quoted 11 lines · On Thu, 23 Apr 2026 17:12:15 -0400 Jamal Hadi Salim <[email protected]> wrote:
Quoted 4 lines
Quoted 1 line

This is intended and explicitly explained in the cover letter.

Jamal, given the uAPI implication, could you please double check that the change is fine?

It should be fine; at least iproute2 will never allow the kernel to receive a negative number.
Stephen brought up the fact that strtod() could return a -ve number (but at least iproute2 makes sure negative numbers are not carried forward to the kernel).

Quoted 7 lines
Quoted 2 lines

cheers,
jamal

Iproute2 blocks negative values kind of by accident.
The NEXT_IS_NUMBER() macro looks for digit at start of arg. To hit this you need to either use raw netlink or change NEXT_IS_NUMBER() to NEXT_IS_SIGNED_NUMBER() where slot values are parsed.

For this specific attribute it was intentional:
...
if (get_time64(&slot.dist_jitter, *argv)) { //get_time64 calls strtod() which could set dist_jitter -ve

    explain1("slot jitter");
     return -1;
}
if (slot.dist_jitter <= 0) {  // we reject -ve values
    fprintf(stderr, "Non-positive jitter\n");
    return -1;
}
Quoted 2 lines

cheers,
jamal

I see no cases where negative time value is a valid input. Doing audit of netem:
- slot times
parsing rejects -10ms for min delay and -100ms for max delay
- delay
negative value is accepted, but internally acts like 0
- jitter
negative value is rejected (i.e What is "-2s")
- slot distribution delay
same as regular delay, accepted but internally acts like 0 negative jitter is rejected "Non positive jitter"

Gate:

Codel:
- setting negative target, interval or ce_threshold gives huge value

    4.29e+03s

Pi:
- setting negative target gets absolute value
Hhf:
- setting negative value gets 4.29e+03s

So I can't see any valid use for negative intervals

author maintainer
#12 lore raw

PATCH v8 5/6 net/sched: netem: fix slot delay calculation overflow

In reply to Stephen Hemminger

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")
---
 net/sched/sch_netem.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/sched/sch_netem.c +2 -3
index 640b51be807a..475c14b3dbdb 100644
@@ -659,9 +659,8 @@ static void get_slot_next(struct netem_sched_data *q, u64 now)
 
 	if (!q->slot_dist)
 		next_delay = q->slot_config.min_delay +
-				(get_random_u32() *
-				 (q->slot_config.max_delay -
-				  q->slot_config.min_delay) >> 32);
+			mul_u64_u32_shr(q->slot_config.max_delay - q->slot_config.min_delay,
+					get_random_u32(), 32);
 	else
 		next_delay = tabledist(q->slot_config.dist_delay,
 				       (s32)(q->slot_config.dist_jitter),
Signature · 1 line
2.53.0
author maintainer
#13 lore raw

PATCH v8 6/6 net/sched: netem: check for negative latency and jitter

In reply to Stephen Hemminger

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")
---
 net/sched/sch_netem.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
net/sched/sch_netem.c +22 -0
index 475c14b3dbdb..bc18e1976b6e 100644
@@ -826,6 +826,16 @@ static int get_dist_table(struct disttable **tbl, const struct nlattr *attr)
 	return 0;
 }
 
+static int validate_time(const struct nlattr *attr, const char *name,
+			 struct netlink_ext_ack *extack)
+{
+	if (nla_get_s64(attr) < 0) {
+		NL_SET_ERR_MSG_ATTR_FMT(extack, attr, "negative %s", name);
+		return -EINVAL;
+	}
+	return 0;
+}
+
 static int validate_slot(const struct nlattr *attr, struct netlink_ext_ack *extack)
 {
 	const struct tc_netem_slot *c = nla_data(attr);
@@ -1068,6 +1078,18 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt,
 			goto table_free;
 	}
 
+	if (tb[TCA_NETEM_LATENCY64]) {
+		ret = validate_time(tb[TCA_NETEM_LATENCY64], "latency", extack);
+		if (ret)
+			goto table_free;
+	}
+
+	if (tb[TCA_NETEM_JITTER64]) {
+		ret = validate_time(tb[TCA_NETEM_JITTER64], "jitter", extack);
+		if (ret)
+			goto table_free;
+	}
+
 	sch_tree_lock(sch);
 	/* backup q->clg and q->loss_model */
 	old_clg = q->clg;
Signature · 1 line
2.53.0
reviewer Reviewed-by on v8 6/6
#14 lore raw

Re: [PATCH net v8 6/6] net/sched: netem: check for negative latency and jitter

Quoted 7 lines · Stephen Hemminger

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.

Quoted 6 lines

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")
#15 lore raw
In reply to Stephen Hemminger
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 15 lines · On Fri, 17 Apr 2026 20:19:38 -0700 you wrote:

These bugs were found when doing AI-assisted review of sch_netem.c during investigation of the packet duplication recursion problem addressed in Jamal's series.

The fixes cover:

- probability gaps in the 4-state Markov loss model
- queue limit not accounting for reordered packets
- PRNG reseeded on every tc change, breaking reproducibility
- slot configuration not validated (inverted ranges, negative delays, negative limits)
- slot delay arithmetic overflow for ranges above ~2.1 seconds
- negative latency and jitter wrapping to huge time_to_send values via u64 arithmetic

Quoted 1 line

[...]

Here is the summary with links:
- [net,v8,1/6] net/sched: netem: fix probability gaps in 4-state loss model

    https://git.kernel.org/netdev/net/c/732b463449fd
  - [net,v8,2/6] net/sched: netem: fix queue limit check to include reordered packets
    https://git.kernel.org/netdev/net/c/4185701fcce6
  - [net,v8,3/6] net/sched: netem: only reseed PRNG when seed is explicitly provided
    https://git.kernel.org/netdev/net/c/986afaf80994
  - [net,v8,4/6] net/sched: netem: validate slot configuration
    https://git.kernel.org/netdev/net/c/01801c359a74
  - [net,v8,5/6] net/sched: netem: fix slot delay calculation overflow
    https://git.kernel.org/netdev/net/c/51e94e1e2fef
  - [net,v8,6/6] net/sched: netem: check for negative latency and jitter
    https://git.kernel.org/netdev/net/c/90be9fedb218

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html