Re: [PATCH net] sch_hhf: fix null pointer dereference on init failure

2017-08-30 Thread Nikolay Aleksandrov
On 30/08/17 04:24, Cong Wang wrote: > On Tue, Aug 29, 2017 at 12:02 PM, Nikolay Aleksandrov > wrote: >> First I did it with the check in the for () conditional, but this is more >> visible and explicit. Let me know if you'd like the shorter version. :-) > > Or, if

Re: [PATCH net] sch_hhf: fix null pointer dereference on init failure

2017-08-29 Thread Cong Wang
On Tue, Aug 29, 2017 at 12:02 PM, Nikolay Aleksandrov wrote: > First I did it with the check in the for () conditional, but this is more > visible and explicit. Let me know if you'd like the shorter version. :-) Or, if you want to make the patch size smaller, just

Re: [PATCH net] sch_hhf: fix null pointer dereference on init failure

2017-08-29 Thread Nikolay Aleksandrov
On 29/08/17 22:02, Nikolay Aleksandrov wrote: > If sch_hhf fails in its ->init() function (either due to wrong > user-space arguments as below or memory alloc failure of hh_flows) it > will do a null pointer deref of q->hh_flows in its ->destroy() function. > > To reproduce the crash: > $ tc

[PATCH net] sch_hhf: fix null pointer dereference on init failure

2017-08-29 Thread Nikolay Aleksandrov
If sch_hhf fails in its ->init() function (either due to wrong user-space arguments as below or memory alloc failure of hh_flows) it will do a null pointer deref of q->hh_flows in its ->destroy() function. To reproduce the crash: $ tc qdisc add dev eth0 root hhf quantum 200 non_hh_weight