linux-stable/drivers/net/wireguard
Jason A. Donenfeld 3f00757ab4 wireguard: allowedips: expand maximum node depth
commit 46622219aa upstream.

In the allowedips self-test, nodes are inserted into the tree, but it
generated an even amount of nodes, but for checking maximum node depth,
there is of course the root node, which makes the total number
necessarily odd. With two few nodes added, it never triggered the
maximum depth check like it should have. So, add 129 nodes instead of
128 nodes, and do so with a more straightforward scheme, starting with
all the bits set, and shifting over one each time. Then increase the
maximum depth to 129, and choose a better name for that variable to
make it clear that it represents depth as opposed to bits.

Cc: stable@vger.kernel.org
Fixes: e7096c131e ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://lore.kernel.org/r/20230807132146.2191597-2-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-16 18:21:57 +02:00
..
selftest wireguard: allowedips: expand maximum node depth 2023-08-16 18:21:57 +02:00
allowedips.c wireguard: allowedips: expand maximum node depth 2023-08-16 18:21:57 +02:00
allowedips.h
cookie.c
cookie.h
device.c
device.h
main.c
Makefile
messages.h
netlink.c wireguard: netlink: send staged packets when setting initial private key 2023-07-23 13:47:37 +02:00
netlink.h
noise.c
noise.h
peer.c
peer.h
peerlookup.c
peerlookup.h
queueing.c wireguard: queueing: use saner cpu selection wrapping 2023-07-23 13:47:37 +02:00
queueing.h wireguard: queueing: use saner cpu selection wrapping 2023-07-23 13:47:37 +02:00
ratelimiter.c
ratelimiter.h
receive.c wireguard: queueing: use saner cpu selection wrapping 2023-07-23 13:47:37 +02:00
send.c wireguard: queueing: use saner cpu selection wrapping 2023-07-23 13:47:37 +02:00
socket.c
socket.h
timers.c
timers.h
version.h