From: John Dykstra <john.dykstra1@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev <netdev@vger.kernel.org>,
Adam Langley <agl@imperialviolet.org>,
YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: [PATCH] tcp: Use correct peer adr when copying MD5 keys (WAS: [PATCHv2] tcp: Fix MD5 signature checking on IPv4 mapped sockets)
Date: Fri, 17 Jul 2009 19:23:22 +0000 [thread overview]
Message-ID: <1247858602.8509.7.camel@Maple> (raw)
In-Reply-To: <20090716113652.65dd1c8d@nehalam>
On Thu, 2009-07-16 at 11:36 -0700, Stephen Hemminger wrote:
> On Thu, 16 Jul 2009 10:04:51 -0500
> John Dykstra <john.dykstra1@gmail.com> wrote:
>
> > This revision to the patch removes a misplaced
> > blank line.
> >
> > ---
> > Fix MD5 signature checking so that an IPv4 active open
> > to an IPv6 socket can succeed. In particular, use the
> > correct address family's signature generation function
> > for the SYN/ACK.
> >
> > Reported-by: Stephen Hemminger <shemminger@vyatta.com>
> > Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
>
> This fixes the syn-ack, but data does not flow.
The following patch is _in addition_ to the one I sent out yesterday.
Since they are independent, and fix different bugs, I'm leaving them
separate.
I guess it's clear not many people are running authenticated BGP
sessions on Linux...
---
[PATCH] tcp: Use correct peer adr when copying MD5 keys
When the TCP connection handshake completes on the passive
side, a variety of state must be set up in the "child" sock,
including the key if MD5 authentication is being used. Fix TCP
for both address families to label the key with the peer's
destination address, rather than the address from the listening
sock, which is usually the wildcard.
Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
---
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv6/tcp_ipv6.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 7c107eb..6d88219 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1374,7 +1374,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
*/
char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC);
if (newkey != NULL)
- tcp_v4_md5_do_add(newsk, inet_sk(sk)->daddr,
+ tcp_v4_md5_do_add(newsk, newinet->daddr,
newkey, key->keylen);
newsk->sk_route_caps &= ~NETIF_F_GSO_MASK;
}
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ae3d657..d849dd5 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1442,7 +1442,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
*/
char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC);
if (newkey != NULL)
- tcp_v6_md5_do_add(newsk, &inet6_sk(sk)->daddr,
+ tcp_v6_md5_do_add(newsk, &newnp->daddr,
newkey, key->keylen);
}
#endif
--
1.5.4.3
next prev parent reply other threads:[~2009-07-17 19:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 15:04 [PATCHv2] tcp: Fix MD5 signature checking on IPv4 mapped sockets John Dykstra
2009-07-16 18:36 ` Stephen Hemminger
2009-07-17 19:23 ` John Dykstra [this message]
2009-07-20 14:50 ` [PATCH] tcp: Use correct peer adr when copying MD5 keys David Miller
2009-07-20 14:50 ` [PATCHv2] tcp: Fix MD5 signature checking on IPv4 mapped sockets David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1247858602.8509.7.camel@Maple \
--to=john.dykstra1@gmail.com \
--cc=agl@imperialviolet.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).