Skip to content
Snippets Groups Projects
Commit bfc6e25c authored by Alaa Hleihel's avatar Alaa Hleihel Committed by Greg Kroah-Hartman
Browse files

net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow


[ Upstream commit eda814b9 ]

tcf_ct_handle_fragments() shouldn't free the skb when ip_defrag() call
fails. Otherwise, we will cause a double-free bug.
In such cases, just return the error to the caller.

Fixes: b57dc7c1 ("net/sched: Introduce action ct")
Signed-off-by: default avatarAlaa Hleihel <alaa@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent de55a7e7
1 merge request!213Update to 5.7.19
......@@ -702,7 +702,7 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
err = ip_defrag(net, skb, user);
local_bh_enable();
if (err && err != -EINPROGRESS)
goto out_free;
return err;
if (!err) {
*defrag = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment