xfrm: Use __skb_queue_tail in xfrm_trans_queue
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 4 Jan 2018 11:25:07 +0000 (22:25 +1100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:55 +0000 (15:50 +0000)
commit d16b46e4fd8bc6063624605f25b8c0835bb1fbe3 upstream.

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>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/xfrm/xfrm_input.c

index 5b7bf13..363e3c7 100644 (file)
@@ -324,7 +324,7 @@ int xfrm_trans_queue(struct sk_buff *skb, int (*finish)(struct sk_buff *))
                return -ENOBUFS;
 
        XFRM_TRANS_SKB_CB(skb)->finish = finish;
                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;
 }
        tasklet_schedule(&trans->tasklet);
        return 0;
 }