* [PATCH] AH4: Update IPv4 options handling to conform to RFC 4302.
@ 2007-08-21 14:44 Nick Bowler
2007-08-22 8:12 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Nick Bowler @ 2007-08-21 14:44 UTC (permalink / raw)
To: linux-kernel
In testing our ESP/AH offload hardware, I discovered an issue with how AH
handles mutable fields in IPv4. RFC 4302 (AH) states the following on the
subject:
For IPv4, the entire option is viewed as a unit; so even
though the type and length fields within most options are immutable
in transit, if an option is classified as mutable, the entire option
is zeroed for ICV computation purposes.
The current implementation does not zero the type and length fields, resulting
in authentication failures when communicating with hosts that do (i.e. FreeBSD).
I have tested record route and timestamp options (ping -R and ping -T) on a
small network involving Windows XP, FreeBSD 6.2, and Linux hosts, with one
router. In the presence of these options, the FreeBSD and Linux hosts (with
the patch or with the hardware) can communicate. The Windows XP host simply
fails to accept these packets with or without the patch.
I have also been trying to test source routing options (using traceroute -g),
but haven't had much luck getting this option to work *without* AH, let alone
with.
Signed-off-by: Nick Bowler <nbowler@ellipticsemi.com>
---
net/ipv4/ah4.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 7a23e59..39f6211 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -46,7 +46,7 @@ static int ip_clear_mutable_options(struct iphdr *iph, __be32 *daddr)
memcpy(daddr, optptr+optlen-4, 4);
/* Fall through */
default:
- memset(optptr+2, 0, optlen-2);
+ memset(optptr, 0, optlen);
}
l -= optlen;
optptr += optlen;
--
1.5.2.2
--
Nick Bowler, Elliptic Semiconductor (http://www.ellipticsemi.com/)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] AH4: Update IPv4 options handling to conform to RFC 4302.
2007-08-21 14:44 [PATCH] AH4: Update IPv4 options handling to conform to RFC 4302 Nick Bowler
@ 2007-08-22 8:12 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2007-08-22 8:12 UTC (permalink / raw)
To: Nick Bowler; +Cc: linux-kernel, David S. Miller, Alexey Kuznetsov
On Tue, Aug 21, 2007 at 02:44:33PM +0000, Nick Bowler wrote:
> In testing our ESP/AH offload hardware, I discovered an issue with how AH
> handles mutable fields in IPv4. RFC 4302 (AH) states the following on the
> subject:
>
> For IPv4, the entire option is viewed as a unit; so even
> though the type and length fields within most options are immutable
> in transit, if an option is classified as mutable, the entire option
> is zeroed for ICV computation purposes.
Good catch! Very few people test IP options so this one slipped
through. Fortunately by the same token we can change this
without anybody noticing.
This requirement isn't new with 4302, 2402 says exactly the
same thing.
Please resend your patch to davem@davemloft.net with a cc to
netdev@vger.kernel.org.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-22 8:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-21 14:44 [PATCH] AH4: Update IPv4 options handling to conform to RFC 4302 Nick Bowler
2007-08-22 8:12 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®