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

From: Stephen Hemminger

Date: Fri Apr 24 2026 - 11:09:19 EST


On Thu, 23 Apr 2026 17:12:15 -0400
Jamal Hadi Salim <jhs@xxxxxxxxxxxx> wrote:

> > > 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

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.