linux-stable/drivers/net/wireguard
Jason A. Donenfeld c991567e6c wireguard: netlink: access device through ctx instead of peer
[ Upstream commit 71cbd32e3d ]

The previous commit fixed a bug that led to a NULL peer->device being
dereferenced. It's actually easier and faster performance-wise to
instead get the device from ctx->wg. This semantically makes more sense
too, since ctx->wg->peer_allowedips.seq is compared with
ctx->allowedips_seq, basing them both in ctx. This also acts as a
defence in depth provision against freed peers.

Cc: stable@vger.kernel.org
Fixes: e7096c131e ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:28:36 +02:00
..
selftest
allowedips.c
allowedips.h
cookie.c
cookie.h
device.c
device.h
main.c
Makefile
messages.h
netlink.c wireguard: netlink: access device through ctx instead of peer 2024-04-03 15:28:36 +02:00
netlink.h
noise.c
noise.h
peer.c
peer.h
peerlookup.c
peerlookup.h
queueing.c
queueing.h
ratelimiter.c
ratelimiter.h
receive.c
send.c
socket.c
socket.h
timers.c
timers.h
version.h