]> git.baikalelectronics.ru Git - kernel.git/commit
wireguard: device: do not generate ICMP for non-IP packets
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 22 Feb 2021 16:25:47 +0000 (17:25 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Feb 2021 23:59:34 +0000 (15:59 -0800)
commitc4465ec84c79481290bf070205e6dc05cfb006bf
tree97c1827635df57d08f3fe2b7ff06caa62581eab5
parentb37c75ff5d61a35731d7f5b57f1d3bb9f30cb60e
wireguard: device: do not generate ICMP for non-IP packets

If skb->protocol doesn't match the actual skb->data header, it's
probably not a good idea to pass it off to icmp{,v6}_ndo_send, which is
expecting to reply to a valid IP packet. So this commit has that early
mismatch case jump to a later error label.

Fixes: 0c73bbc77a76 ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wireguard/device.c