diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-05-20 14:32:14 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-06-16 13:19:55 -0700 |
commit | 28cdf87938f6d470098c85d4f1694276dc85958d (patch) | |
tree | 523f42636f819b8459d6c4409d423911929c73dd /net | |
parent | 58c1bcf7e5454a95ef8997f7c769361d687bfd82 (diff) | |
download | lwn-28cdf87938f6d470098c85d4f1694276dc85958d.tar.gz lwn-28cdf87938f6d470098c85d4f1694276dc85958d.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/route.c | 2 | ||||
-rw-r--r-- | net/ipv6/route.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 7b5e8e1d94be..d39cf9fea96e 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -162,7 +162,7 @@ static struct dst_ops ipv4_dst_ops = { .negative_advice = ipv4_negative_advice, .link_failure = ipv4_link_failure, .update_pmtu = ip_rt_update_pmtu, - .local_out = ip_local_out, + .local_out = __ip_local_out, .entry_size = sizeof(struct rtable), .entries = ATOMIC_INIT(0), }; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e8b241cb60bc..f95745fbf067 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -105,7 +105,7 @@ static struct dst_ops ip6_dst_ops = { .negative_advice = ip6_negative_advice, .link_failure = ip6_link_failure, .update_pmtu = ip6_rt_update_pmtu, - .local_out = ip6_local_out, + .local_out = __ip6_local_out, .entry_size = sizeof(struct rt6_info), .entries = ATOMIC_INIT(0), }; |