]> git.baikalelectronics.ru Git - 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)
commitee736d10c1dc74a7793324973ef225f1e7279c06
tree2ca6509d139079ad95e37bdfb94bf570fc094a6d
parentfa778c4906a7d45a45116434e314d2b6ff9dadd1
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: 4da5e75a3753 ("[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