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

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>
  • Loading branch information
alaahl authored and davem330 committed Aug 20, 2020
1 parent ab921f3 commit eda814b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/act_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,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;
Expand Down

0 comments on commit eda814b

Please sign in to comment.