[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dc61a214-2825-7bec-890c-069795a182a0@mojatatu.com>
Date: Tue, 24 Jan 2017 06:46:48 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Daniel Borkmann <daniel@...earbox.net>,
Simon Horman <simon.horman@...ronome.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, jiri@...lanox.com,
paulb@...lanox.com, john.fastabend@...il.com, mrv@...atatu.com,
hadarh@...lanox.com, ogerlitz@...lanox.com, roid@...lanox.com,
xiyou.wangcong@...il.com
Subject: Re: [PATCH net-next v6 1/1] net sched actions: Add support for user
cookies
On 17-01-23 11:18 AM, Daniel Borkmann wrote:
> On 01/23/2017 01:58 PM, Simon Horman wrote:
>> Hi Jamal,
>>
>> On Sun, Jan 22, 2017 at 03:25:50PM -0500, Jamal Hadi Salim wrote:
>>
>> ...
>>
>>> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
>>> index cd08df9..58cf1c5 100644
>>> --- a/net/sched/act_api.c
>>> +++ b/net/sched/act_api.c
>>> @@ -24,6 +24,7 @@
>>> #include <net/net_namespace.h>
>>> #include <net/sock.h>
>>> #include <net/sch_generic.h>
>>> +#include <net/pkt_cls.h>
>>> #include <net/act_api.h>
>>> #include <net/netlink.h>
>>>
>>> @@ -33,6 +34,8 @@ static void free_tcf(struct rcu_head *head)
>>>
>>> free_percpu(p->cpu_bstats);
>>> free_percpu(p->cpu_qstats);
>>> + kfree(p->act_cookie->data);
>>
>> Does the above need to be protected by a check for p->act_cookie being
>> non-NULL?
>
> Yep, that would be a NULL-deref. Why not just embedd tc_cookie as
> suggested earlier, the struct is rather small anyway ...
>
Everytime I make a change like that i seem to forget to run one
more test and it creates more bugs (example, the last two resends
are errors introduced by changing the struct from last one which
was your suggestion;->).
So you will have to forgive me I am not going back to that
definition; I will post version 7 soon.
cheers,
jamal
Powered by blists - more mailing lists