Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit e11c52eb authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by Alexander Martinz
Browse files

UPSTREAM: wireguard: netlink: access device through ctx instead of peer



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.

Bug: 254441685
Cc: stable@vger.kernel.org
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
(cherry picked from commit 71cbd32e3db82ea4a74e3ef9aeeaa6971969c86f)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I371aff4e14ab44a973c92dec76f4be07ab3ee4e3
parent 4b23659b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment