Netdev Archive on
help / color / mirror / Atom feed
From: Alaa Hleihel <>
Cc:,,, Roi Dayan <>
Subject: [PATCH net] net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow
Date: Wed, 19 Aug 2020 18:24:10 +0300	[thread overview]
Message-ID: <> (raw)

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: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: Alaa Hleihel <>
Reviewed-by: Roi Dayan <>
 net/sched/act_ct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index e6ad42b11835..2c3619165680 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -704,7 +704,7 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
 		err = ip_defrag(net, skb, user);
 		if (err && err != -EINPROGRESS)
-			goto out_free;
+			return err;
 		if (!err) {
 			*defrag = true;

             reply	other threads:[~2020-08-19 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 15:24 Alaa Hleihel [this message]
2020-08-20 23:40 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH net] net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).