lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Sep 2014 20:04:37 -0700
From:	Cong Wang <cwang@...pensource.com>
To:	John Fastabend <john.fastabend@...il.com>
Cc:	Cong Wang <xiyou.wangcong@...il.com>,
	David Miller <davem@...emloft.net>,
	Eric Dumazet <eric.dumazet@...il.com>,
	netdev <netdev@...r.kernel.org>,
	Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [net-next PATCH 3/3] net: sched: cls_cgroup fix possible memory
 leak of 'new'

On Mon, Sep 15, 2014 at 7:48 PM, John Fastabend
<john.fastabend@...il.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. :)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ