Files
kernel_google_b1c1/include/net
Pablo Neira Ayuso 625cb13a89 netfilter: nf_tables: set pktinfo->thoff at AH header if found
[ Upstream commit 568af6de058cb2b0c5b98d98ffcf37cdc6bc38a7 ]

Phil Sutter reports that IPv6 AH header matching is broken. From
userspace, nft generates bytecode that expects to find the AH header at
NFT_PAYLOAD_TRANSPORT_HEADER both for IPv4 and IPv6. However,
pktinfo->thoff is set to the inner header after the AH header in IPv6,
while in IPv4 pktinfo->thoff points to the AH header indeed. This
behaviour is inconsistent. This patch fixes this problem by updating
ipv6_find_hdr() to get the IP6_FH_F_AUTH flag so this function stops at
the AH header, so both IPv4 and IPv6 pktinfo->thoff point to the AH
header.

This is also inconsistent when trying to match encapsulated headers:

1) A packet that looks like IPv4 + AH + TCP dport 22 will *not* match.
2) A packet that looks like IPv6 + AH + TCP dport 22 will match.

Reported-by: Phil Sutter <phil@nwl.cc>
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>
2017-10-08 10:26:11 +02:00
..
2016-09-27 21:15:21 -04:00
2016-09-23 08:38:50 -04:00
2017-06-07 12:07:46 +02:00
2016-10-14 10:59:15 -04:00
2017-08-30 10:21:40 +02:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2016-09-10 23:12:53 -07:00
2016-11-03 16:16:50 -04:00
2017-07-21 07:42:18 +02:00