Thread (8 messages) 8 messages, 3 authors, 2020-02-06

Re: [PATCH v2 net] net: sched: prevent a use after free

From: David Miller <davem@davemloft.net>
Date: 2020-02-06 13:01:43
Also in: kernel-janitors

From: Dan Carpenter <redacted>
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 <redacted>
Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler")
Signed-off-by: Dan Carpenter <redacted>
---
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help