]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
netfilter: don't track fragmented packets
authorFlorian Westphal <fw@strlen.de>
Fri, 3 Mar 2017 20:44:00 +0000 (21:44 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 13 Mar 2018 10:27:29 +0000 (11:27 +0100)
commite9f1610dc6d869783ab2b7cad0582dbbf452b037
tree383176fcea2585bc9ba9838ee0990ce2355c95b3
parent1f2890134c976c926402517322a5350c3d08143d
netfilter: don't track fragmented packets

BugLink: http://bugs.launchpad.net/bugs/1745047
[ Upstream commit 7b4fdf77a450ec0fdcb2f677b080ddbf2c186544 ]

Andrey reports syzkaller splat caused by

NF_CT_ASSERT(!ip_is_fragment(ip_hdr(skb)));

in ipv4 nat.  But this assertion (and the comment) are wrong, this function
does see fragments when IP_NODEFRAG setsockopt is used.

As conntrack doesn't track packets without complete l4 header, only the
first fragment is tracked.

Because applying nat to first packet but not the rest makes no sense this
also turns off tracking of all fragments.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/netfilter/nf_nat_l3proto_ipv4.c