]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
xfrm: Reinject transport-mode packets through tasklet
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 Dec 2017 05:40:44 +0000 (16:40 +1100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Tue, 19 Dec 2017 07:23:21 +0000 (08:23 +0100)
commitacf568ee859f098279eadf551612f103afdacb4e
tree2ca6509d139079ad95e37bdfb94bf570fc094a6d
parentd2950278d2d04ff5314abeb38d9c59c4e7c0ee53
xfrm: Reinject transport-mode packets through tasklet

This is an old bugbear of mine:

https://www.mail-archive.com/netdev@vger.kernel.org/msg03894.html

By crafting special packets, it is possible to cause recursion
in our kernel when processing transport-mode packets at levels
that are only limited by packet size.

The easiest one is with DNAT, but an even worse one is where
UDP encapsulation is used in which case you just have to insert
an UDP encapsulation header in between each level of recursion.

This patch avoids this problem by reinjecting tranport-mode packets
through a tasklet.

Fixes: b05e106698d9 ("[IPV4/6]: Netfilter IPsec input hooks")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/net/xfrm.h
net/ipv4/xfrm4_input.c
net/ipv6/xfrm6_input.c
net/xfrm/xfrm_input.c