selftests: netfilter: check icmp pkttoobig errors are set as related
authorFlorian Westphal <fw@strlen.de>
Mon, 25 Mar 2019 22:11:53 +0000 (23:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:43:42 +0000 (19:43 +0200)
commit3a1de1acf46a9b56fee28e917577d3260d49ccb9
tree9f6d3109934f9a5bc705502a168a5c381e433141
parentf351f4ae81d738c72bc0934dc32a8b6b2608f78f
selftests: netfilter: check icmp pkttoobig errors are set as related

[ Upstream commit becf2319f320cae43e20cf179cc51a355a0deb5f ]

When an icmp error such as pkttoobig is received, conntrack checks
if the "inner" header (header of packet that did not fit link mtu)
is matches an existing connection, and, if so, sets that packet as
being related to the conntrack entry it found.

It was recently reported that this "related" setting also works
if the inner header is from another, different connection (i.e.,
artificial/forged icmp error).

Add a test, followup patch will add additional "inner dst matches
outer dst in reverse direction" check before setting related state.

Link: https://www.synacktiv.com/posts/systems/icmp-reachable.html
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/netfilter/Makefile
tools/testing/selftests/netfilter/conntrack_icmp_related.sh [new file with mode: 0755]