xfrm: Generate blackhole routes only from route lookup functions
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 16 Sep 2014 08:08:40 +0000 (10:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2014 06:36:42 +0000 (08:36 +0200)
commit0845e2d0da03b2d739c87219ad212e604bf57431
treecb3169d65d3c029890614e5b808836dc661bd662
parent152fc44a111f94a03e45c09c0ad200e6a93808dc
xfrm: Generate blackhole routes only from route lookup functions

[ Upstream commit f92ee61982d6da15a9e49664ecd6405a15a2ee56 ]

Currently we genarate a blackhole route route whenever we have
matching policies but can not resolve the states. Here we assume
that dst_output() is called to kill the balckholed packets.
Unfortunately this assumption is not true in all cases, so
it is possible that these packets leave the system unwanted.

We fix this by generating blackhole routes only from the
route lookup functions, here we can guarantee a call to
dst_output() afterwards.

Fixes: 2774c131b1d ("xfrm: Handle blackhole route creation via afinfo.")
Reported-by: Konstantinos Kolelis <k.kolelis@sirrix.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/dst.h
net/ipv4/route.c
net/ipv6/ip6_output.c
net/xfrm/xfrm_policy.c