]> git.baikalelectronics.ru Git - kernel.git/commit
esp: Fix locking on page fragment allocation
authorSteffen Klassert <steffen.klassert@secunet.com>
Fri, 25 Aug 2017 05:16:07 +0000 (07:16 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 25 Aug 2017 07:26:12 +0000 (09:26 +0200)
commit5a69d6656c55a9e1211f0309f0bd7508bf2e2a9f
tree4630219935215d5488958b705ee3a84ffccf17bf
parenta460602b20e912764dd98da2a550ff8664e1e172
esp: Fix locking on page fragment allocation

We allocate the page fragment for the ESP trailer inside
a spinlock, but consume it outside of the lock. This
is racy as some other cou could get the same page fragment
then. Fix this by consuming the page fragment inside the
lock too.

Fixes: 1f6f9496b0f0 ("esp4: Avoid skb_cow_data whenever possible")
Fixes: 73a7b070a864 ("esp6: Avoid skb_cow_data whenever possible")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/esp4.c
net/ipv6/esp6.c