[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200206.140137.826534991746807346.davem@davemloft.net>
Date: Thu, 06 Feb 2020 14:01:37 +0100 (CET)
From: David Miller <davem@...emloft.net>
To: dan.carpenter@...cle.com
Cc: jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
kuba@...nel.org, mohitbhasi1998@...il.com,
vsaicharan1998@...il.com, lesliemonis@...il.com,
sdp.sachin@...il.com, gautamramk@...il.com, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH v2 net] net: sched: prevent a use after free
From: Dan Carpenter <dan.carpenter@...cle.com>
Date: Wed, 5 Feb 2020 14:53:30 +0300
> The bug is that we call kfree_skb(skb) and then pass "skb" to
> qdisc_pkt_len(skb) on the next line, which is a use after free.
> Also Cong Wang points out that it's better to delay the actual
> frees until we drop the rtnl lock so we should use rtnl_kfree_skbs()
> instead of kfree_skb().
>
> Cc: Cong Wang <xiyou.wangcong@...il.com>
> Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> v2: Use rtnl_kfree_skbs() instead of kfree_skb(). From static analysis.
> Not tested, but I have audited the code pretty close and I think
> switing to rtnl_kfree_skbs() is harmless.
Applied, thanks Dan.
Powered by blists - more mailing lists