Skip to content

Commit eda814b

Browse files
alaahldavem330
authored andcommitted
net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error 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 <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ab921f3 commit eda814b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/act_ct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
704704
err = ip_defrag(net, skb, user);
705705
local_bh_enable();
706706
if (err && err != -EINPROGRESS)
707-
goto out_free;
707+
return err;
708708

709709
if (!err) {
710710
*defrag = true;

0 commit comments

Comments
 (0)