wireguard-freebsd/src
Jason A. Donenfeld 65c2211c61 if_wg: do not allow ioctl to race with clone_destroy
This fixes the crash from:

bash -c 'while true; do ifconfig wg0 create; ifconfig wg0 destroy; done&
while true; do wg show wg0 > /dev/null 2>&1; done& wait'

Since we're setting ifp to NULL here, we also have to account for
multicast v6 packets being transmitted during destroy, which can be
triggered by:

  ifconfig wg0 create
  ifconfig wg0 inet6 fe80::1234/120
  ifconfig wg0 up
  route add -inet6 ff02::1:0/120 -iface wg0
  ifconfig wg0 destroy

These are unfixed upstream bug that we're working around.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-04-15 18:22:10 -06:00
..
Makefile compat: backport to FreeBSD 12.2 2021-03-18 09:00:52 -06:00
compat.h compat: backport callout_func_t to 12.1 2021-03-19 13:41:38 -06:00
crypto.c Initial import 2021-03-17 09:35:54 -06:00
crypto.h Initial import 2021-03-17 09:35:54 -06:00
if_wg.c if_wg: do not allow ioctl to race with clone_destroy 2021-04-15 18:22:10 -06:00
if_wg.h Initial import 2021-03-17 09:35:54 -06:00
support.h compat: backport to FreeBSD 12.2 2021-03-18 09:00:52 -06:00
version.h version: bump 2021-04-12 21:05:12 -06:00
wg_cookie.c compat: backport to FreeBSD 12.2 2021-03-18 09:00:52 -06:00
wg_cookie.h Initial import 2021-03-17 09:35:54 -06:00
wg_noise.c wg_noise: ensure non-zero'd handshakes have a valid local index 2021-03-22 11:46:02 -06:00
wg_noise.h Initial import 2021-03-17 09:35:54 -06:00