* [PATCH v2] net/sched: Fix divide error in tabledist
@ 2025-12-22 6:13 Manas
2025-12-27 19:49 ` Cong Wang
0 siblings, 1 reply; 5+ messages in thread
From: Manas @ 2025-12-22 6:13 UTC (permalink / raw)
To: stephen
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, horms,
netdev, linux-kernel, Manas
Previously, a duplication check was added to ensure that a
duplicating netem cannot exist in a tree with other netems. When
check_netem_in_tree() fails after parameter updates, the qdisc
structure is left in an inconsistent state with some new values
applied but duplicate not updated. Move the tree validation check
before modifying any qdisc parameters
v1 -> v2: Fix whitespace
---
net/sched/sch_netem.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 32a5f3304046..1a2b498ada83 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -1055,6 +1055,11 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt,
q->loss_model = CLG_RANDOM;
}
+ ret = check_netem_in_tree(sch, qopt->duplicate, extack);
+ if (ret)
+ goto unlock;
+ q->duplicate = qopt->duplicate;
+
if (delay_dist)
swap(q->delay_dist, delay_dist);
if (slot_dist)
@@ -1068,12 +1073,6 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt,
q->counter = 0;
q->loss = qopt->loss;
- ret = check_netem_in_tree(sch, qopt->duplicate, extack);
- if (ret)
- goto unlock;
-
- q->duplicate = qopt->duplicate;
-
/* for compatibility with earlier versions.
* if gap is set, need to assume 100% probability
*/
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] net/sched: Fix divide error in tabledist
2025-12-22 6:13 [PATCH v2] net/sched: Fix divide error in tabledist Manas
@ 2025-12-27 19:49 ` Cong Wang
2025-12-28 15:24 ` Manas Ghandat
0 siblings, 1 reply; 5+ messages in thread
From: Cong Wang @ 2025-12-27 19:49 UTC (permalink / raw)
To: Manas
Cc: stephen, jhs, jiri, davem, edumazet, kuba, pabeni, horms, netdev,
linux-kernel
Hi Manas,
On Mon, Dec 22, 2025 at 11:43:06AM +0530, Manas wrote:
> Previously, a duplication check was added to ensure that a
> duplicating netem cannot exist in a tree with other netems. When
> check_netem_in_tree() fails after parameter updates, the qdisc
> structure is left in an inconsistent state with some new values
> applied but duplicate not updated. Move the tree validation check
> before modifying any qdisc parameters
We are reverting the check_netem_in_tree() code due to user-space
breakage. I hope reverting it could also fix the bug you repported here?
See: https://lore.kernel.org/netdev/20251227194135.1111972-3-xiyou.wangcong@gmail.com/
Thanks!
Cong
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] net/sched: Fix divide error in tabledist
2025-12-27 19:49 ` Cong Wang
@ 2025-12-28 15:24 ` Manas Ghandat
2026-02-25 16:35 ` Manas Ghandat
0 siblings, 1 reply; 5+ messages in thread
From: Manas Ghandat @ 2025-12-28 15:24 UTC (permalink / raw)
To: Cong Wang
Cc: stephen, jhs, jiri, davem, edumazet, kuba, pabeni, horms, netdev,
linux-kernel
Hi Cong,
On 12/28/25 01:19, Cong Wang wrote:
> We are reverting the check_netem_in_tree() code due to user-space
> breakage. I hope reverting it could also fix the bug you repported here?
>
> See: https://lore.kernel.org/netdev/20251227194135.1111972-3-xiyou.wangcong@gmail.com/
>
> Thanks!
> Cong
Reverting the above patch would fix the bug which I have reported.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] net/sched: Fix divide error in tabledist
2025-12-28 15:24 ` Manas Ghandat
@ 2026-02-25 16:35 ` Manas Ghandat
2026-02-25 17:38 ` Jamal Hadi Salim
0 siblings, 1 reply; 5+ messages in thread
From: Manas Ghandat @ 2026-02-25 16:35 UTC (permalink / raw)
To: Cong Wang
Cc: stephen, jhs, jiri, davem, edumazet, kuba, pabeni, horms, netdev,
linux-kernel
Hi,
I just wanted an update since the patch has not been merged yet.
On 12/28/25 20:54, Manas Ghandat wrote:
>
> Hi Cong,
>
> On 12/28/25 01:19, Cong Wang wrote:
>> We are reverting the check_netem_in_tree() code due to user-space
>> breakage. I hope reverting it could also fix the bug you repported here?
>>
>> See: https://lore.kernel.org/netdev/20251227194135.1111972-3-xiyou.wangcong@gmail.com/
>>
>> Thanks!
>> Cong
>
> Reverting the above patch would fix the bug which I have reported.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] net/sched: Fix divide error in tabledist
2026-02-25 16:35 ` Manas Ghandat
@ 2026-02-25 17:38 ` Jamal Hadi Salim
0 siblings, 0 replies; 5+ messages in thread
From: Jamal Hadi Salim @ 2026-02-25 17:38 UTC (permalink / raw)
To: Manas Ghandat
Cc: Cong Wang, stephen, jiri, davem, edumazet, kuba, pabeni, horms,
netdev, linux-kernel
On Wed, Feb 25, 2026 at 11:35 AM Manas Ghandat <ghandatmanas@gmail.com> wrote:
>
> Hi,
>
> I just wanted an update since the patch has not been merged yet.
>
Patience please...
cheers,
jamal
> On 12/28/25 20:54, Manas Ghandat wrote:
> >
> > Hi Cong,
> >
> > On 12/28/25 01:19, Cong Wang wrote:
> >> We are reverting the check_netem_in_tree() code due to user-space
> >> breakage. I hope reverting it could also fix the bug you repported here?
> >>
> >> See: https://lore.kernel.org/netdev/20251227194135.1111972-3-xiyou.wangcong@gmail.com/
> >>
> >> Thanks!
> >> Cong
> >
> > Reverting the above patch would fix the bug which I have reported.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-25 17:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 6:13 [PATCH v2] net/sched: Fix divide error in tabledist Manas
2025-12-27 19:49 ` Cong Wang
2025-12-28 15:24 ` Manas Ghandat
2026-02-25 16:35 ` Manas Ghandat
2026-02-25 17:38 ` Jamal Hadi Salim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox