netfilter: xt_TCPMSS: add more sanity tests on tcph->doff
authorEric Dumazet <edumazet@google.com>
Mon, 3 Apr 2017 17:55:11 +0000 (10:55 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:22 +0000 (18:32 +0000)
commitd84eeff84e9869d29f442ff652ce1352cfa63e84
treeed0c9c4357b22d8ac2620a189d0ee338220a82c2
parent5cffeb8cddf32488fd882cf8a830c4a484463f2e
netfilter: xt_TCPMSS: add more sanity tests on tcph->doff

commit 2638fd0f92d4397884fd991d8f4925cb3f081901 upstream.

Denys provided an awesome KASAN report pointing to an use
after free in xt_TCPMSS

I have provided three patches to fix this issue, either in xt_TCPMSS or
in xt_tcpudp.c. It seems xt_TCPMSS patch has the smallest possible
impact.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/netfilter/xt_TCPMSS.c