OSDN Git Service

wireguard: allowedips: initialize list head in selftest
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 4 Jun 2021 15:17:35 +0000 (17:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Jun 2021 21:25:14 +0000 (14:25 -0700)
commit46cfe8eee285cde465b420637507884551f5d7ca
tree92c5b1dd5a4a90ed7a6bd14e50d781513a28112e
parenta4e9f8e3287c9eb6bf70df982870980dd3341863
wireguard: allowedips: initialize list head in selftest

The randomized trie tests weren't initializing the dummy peer list head,
resulting in a NULL pointer dereference when used. Fix this by
initializing it in the randomized trie test, just like we do for the
static unit test.

While we're at it, all of the other strings like this have the word
"self-test", so add it to the missing place here.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: stable@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireguard/selftest/allowedips.c