ipsec: Use the correct ip_local_out function
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 May 2008 21:32:14 +0000 (14:32 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 16 Jun 2008 20:19:55 +0000 (13:19 -0700)
commit28cdf87938f6d470098c85d4f1694276dc85958d
tree523f42636f819b8459d6c4409d423911929c73dd
parent58c1bcf7e5454a95ef8997f7c769361d687bfd82
ipsec: Use the correct ip_local_out function

[ upstream commit: 1ac06e0306d0192a7a4d9ea1c9e06d355ce7e7d3 ]

Because the IPsec output function xfrm_output_resume does its
own dst_output call it should always call __ip_local_output
instead of ip_local_output as the latter may invoke dst_output
directly.  Otherwise the return values from nf_hook and dst_output
may clash as they both use the value 1 but for different purposes.

When that clash occurs this can cause a packet to be used after
it has been freed which usually leads to a crash.  Because the
offending value is only returned from dst_output with qdiscs
such as HTB, this bug is normally not visible.

Thanks to Marco Berizzi for his perseverance in tracking this
down.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/ipv4/route.c
net/ipv6/route.c