From: Herbert Xu <herbert@gondor.apana.org.au>
To: Artem Savkov <asavkov@redhat.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] xfrm: Use __skb_queue_tail in xfrm_trans_queue
Date: Thu, 4 Jan 2018 22:25:07 +1100 [thread overview]
Message-ID: <20180104112507.GB6437@gondor.apana.org.au> (raw)
In-Reply-To: <20180104112026.436rgqaeokcden4r@shodan.usersys.redhat.com>
On Thu, Jan 04, 2018 at 12:20:26PM +0100, Artem Savkov wrote:
> Right, thats a better solution.
>
> Reported-and-tested-by: Artem Savkov <asavkov@redhat.com>
Thanks!
But I just realised that this patch is based on my dirty tree.
So here is a rebased version:
---8<---
We do not need locking in xfrm_trans_queue because it is designed
to use per-CPU buffers. However, the original code incorrectly
used skb_queue_tail which takes the lock. This patch switches
it to __skb_queue_tail instead.
Reported-and-tested-by: Artem Savkov <asavkov@redhat.com>
Fixes: acf568ee859f ("xfrm: Reinject transport-mode packets...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 444fa37..9dbf425 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -508,7 +508,7 @@ int xfrm_trans_queue(struct sk_buff *skb,
return -ENOBUFS;
XFRM_TRANS_SKB_CB(skb)->finish = finish;
- skb_queue_tail(&trans->queue, skb);
+ __skb_queue_tail(&trans->queue, skb);
tasklet_schedule(&trans->tasklet);
return 0;
}
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2018-01-04 11:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 10:36 [PATCH] xfrm: init skb_head lock for transport-mode packets Artem Savkov
2018-01-04 11:01 ` Herbert Xu
2018-01-04 11:20 ` Artem Savkov
2018-01-04 11:25 ` Herbert Xu [this message]
2018-01-05 10:31 ` [PATCH v2] xfrm: Use __skb_queue_tail in xfrm_trans_queue Steffen Klassert
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=20180104112507.GB6437@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=asavkov@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/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