netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wenxu@ucloud.cn
To: netdev@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: [PATCH net-next v2 3/3] net/sched: act_ct: fix clobber qdisc_skb_cb in defrag
Date: Tue,  7 Jul 2020 12:55:11 +0800	[thread overview]
Message-ID: <1594097711-9365-4-git-send-email-wenxu@ucloud.cn> (raw)
In-Reply-To: <1594097711-9365-1-git-send-email-wenxu@ucloud.cn>

From: wenxu <wenxu@ucloud.cn>

using ip_defrag_ignore_cb to defrag in act_ct to elide CB clear.
Avoid serious crashes and problems in ct subsystem. Because Some packet
schedulers store pointers in the qdisc CB private area and Parallel
accesses to the SKB.

Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 net/sched/act_ct.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index 20f3d11..a8e9e62 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -697,10 +697,7 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
 	if (family == NFPROTO_IPV4) {
 		enum ip_defrag_users user = IP_DEFRAG_CONNTRACK_IN + zone;
 
-		memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
-		local_bh_disable();
-		err = ip_defrag(net, skb, user);
-		local_bh_enable();
+		err = ip_defrag_ignore_cb(net, skb, user, NULL);
 		if (err && err != -EINPROGRESS)
 			goto out_free;
 	} else { /* NFPROTO_IPV6 */
-- 
1.8.3.1


  parent reply	other threads:[~2020-07-07  4:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07  4:55 [PATCH net-next v2 0/3] make nf_ct_frag/6_gather elide the skb CB clear wenxu
2020-07-07  4:55 ` [PATCH net-next v2 1/3] net: ip_fragment: Add ip_defrag_ignore_cb support wenxu
2020-07-07  4:55 ` [PATCH net-next v2 2/3] netfilter: nf_conntrack_reasm: make nf_ct_frag6_gather elide the CB clear wenxu
2020-07-07  4:55 ` wenxu [this message]
2020-07-15 20:26 ` [PATCH net-next v2 0/3] make nf_ct_frag/6_gather elide the skb " Jakub Kicinski
2020-07-15 21:17   ` Florian Westphal
2020-07-16  2:42     ` wenxu
2020-07-17 15:32     ` Cong Wang

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1594097711-9365-4-git-send-email-wenxu@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).