Skip to content

Commit

Permalink
net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() e…
Browse files Browse the repository at this point in the history
…rror flow

[ Upstream commit eda814b ]

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: b57dc7c ("net/sched: Introduce action ct")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
alaahl authored and gregkh committed Sep 3, 2020
1 parent 97a7434 commit e1334c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/act_ct.c
Expand Up @@ -186,7 +186,7 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
err = nf_ct_frag6_gather(net, skb, user);
if (err && err != -EINPROGRESS)
goto out_free;
return err;
#else
err = -EOPNOTSUPP;
goto out_free;
Expand Down

0 comments on commit e1334c4

Please sign in to comment.