[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 04 Apr 2019 10:47:20 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: dcaratti@...hat.com
Cc: mcroce@...hat.com, netdev@...r.kernel.org, jhs@...atatu.com,
xiyou.wangcong@...il.com, jiri@...nulli.us, yotamg@...lanox.com
Subject: Re: [PATCH net] net/sched: act_sample: fix divide by zero in the
traffic path
From: Davide Caratti <dcaratti@...hat.com>
Date: Thu, 4 Apr 2019 12:31:35 +0200
> the control path of 'sample' action does not validate the value of 'rate'
> provided by the user, but then it uses it as divisor in the traffic path.
> Validate it in tcf_sample_init(), and return -EINVAL with a proper extack
> message in case that value is zero, to fix a splat with the script below:
...
> Add a TDC selftest to document that 'rate' is now being validated.
>
> Reported-by: Matteo Croce <mcroce@...hat.com>
> Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action")
> Signed-off-by: Davide Caratti <dcaratti@...hat.com>
Applied and queued up for -stable.
Thanks for adding a unit test.
Powered by blists - more mailing lists