l2tp: hold socket before dropping lock in l2tp_ip{, 6}_recv()
authorGuillaume Nault <g.nault@alphalink.fr>
Tue, 29 Nov 2016 12:09:45 +0000 (13:09 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 1 Jan 2018 20:51:01 +0000 (20:51 +0000)
commit4ea094bb4db82122d8ebc84e9f10293e56453690
tree266d1d1a63fb10576aae4897aa386346887aa61c
parent308581eef46759d036ba7d20854f87b238030cb1
l2tp: hold socket before dropping lock in l2tp_ip{, 6}_recv()

commit a3c18422a4b4e108bcf6a2328f48867e1003fd95 upstream.

Socket must be held while under the protection of the l2tp lock; there
is no guarantee that sk remains valid after the read_unlock_bh() call.

Same issue for l2tp_ip and l2tp_ip6.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2:
 - Drop changes in l2tp_ip6.c
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/l2tp/l2tp_ip.c