From: John Fastabend <john.r.fastabend@intel•com>
To: Cong Wang <cwang@twopensource•com>,
John Fastabend <john.fastabend@gmail•com>
Cc: Cong Wang <xiyou.wangcong@gmail•com>,
David Miller <davem@davemloft•net>,
Eric Dumazet <eric.dumazet@gmail•com>,
netdev <netdev@vger•kernel.org>,
Jamal Hadi Salim <jhs@mojatatu•com>
Subject: Re: [net-next PATCH 3/3] net: sched: cls_cgroup fix possible memory leak of 'new'
Date: Mon, 15 Sep 2014 20:29:05 -0700 [thread overview]
Message-ID: <5417AE81.4030501@intel.com> (raw)
In-Reply-To: <CAHA+R7Pz2sCRC7BYAtd2P48gy2oxb=YfJqmx4=+8gKEyLwvMBA@mail.gmail.com>
On 09/15/2014 08:04 PM, Cong Wang wrote:
> On Mon, Sep 15, 2014 at 7:48 PM, John Fastabend
> <john.fastabend@gmail•com> wrote:
>> diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
>> index 3b75487..52b7900 100644
>> --- a/net/sched/cls_cgroup.c
>> +++ b/net/sched/cls_cgroup.c
>> @@ -127,16 +127,16 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
>> err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS],
>> cgroup_policy);
>> if (err < 0)
>> - return err;
>> + goto errout;
>>
>> tcf_exts_init(&e, TCA_CGROUP_ACT, TCA_CGROUP_POLICE);
>> err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr);
>> if (err < 0)
>> - return err;
>> + goto errout;
>>
>> err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &t);
>> if (err < 0)
>> - return err;
>> + goto errout;
>>
>
> I think you need to call tcf_exts_destroy() too after tcf_exts_validate(),
> while you are on it. :)
Yep, and did a quick audit looks like its handled correctly in the other
classifiers.
Also there is a needed fix for cls_fw I'll include with the update for this patch.
.John
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger•kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2014-09-16 3:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-16 2:47 [net-next PATCH 1/3] net: sched: fix unsued cpu variable John Fastabend
2014-09-16 2:48 ` [net-next PATCH 2/3] net: sched: cls_u32 add missing rcu_assign_pointer and annotation John Fastabend
2014-09-16 6:25 ` John Fastabend
2014-09-16 2:48 ` [net-next PATCH 3/3] net: sched: cls_cgroup fix possible memory leak of 'new' John Fastabend
2014-09-16 3:04 ` Cong Wang
2014-09-16 3:29 ` John Fastabend [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5417AE81.4030501@intel.com \
--to=john.r.fastabend@intel$(echo .)com \
--cc=cwang@twopensource$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=jhs@mojatatu$(echo .)com \
--cc=john.fastabend@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=xiyou.wangcong@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox