From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Daniel Borkmann' <daniel@iogearbox.net>,
Neil Horman <nhorman@tuxdriver.com>,
"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
Vlad Yasevich <vyasevich@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket
Date: Wed, 27 May 2015 16:31:57 +0000 [thread overview]
Message-ID: <20150527163157.GA15041@obsidianresearch.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CB40D32@AcuExch.aculab.com>
On Wed, May 27, 2015 at 04:16:44PM +0000, David Laight wrote:
> From: Jason Gunthorpe
> > Sent: 27 May 2015 16:32
> > On Wed, May 27, 2015 at 10:11:22AM +0000, David Laight wrote:
> >
> > > In any case it looks like I can escape by turning off
> > > SCTP_I_WANT_MAPPED_V4_ADDR for kernels 3.17 through 4.0.
> >
> > Just be aware that option is unusable on kernels without 299ee.
> >
> > I fixed everything wrong I saw, but that doesn't mean it works
> > 100%. Honestly, I don't think anyone has ever used it.
>
> I'm now confused.
>
> I've just done a test using a 4.0.0-rc1 kernel.
> I'm binding an IPv6 listening socket and then connecting to it
> from 127.0.0.1.
> I don't know it I'm being given an IPv4 format address or a
> v6mapped one (I shorten the latter before tracing it) - but
> it contains 127.0.0.1 (not 0.0.0.0).
> (That is without changing any socket options.)
I don't know what your test does, but I used the same basic idea with
loopback to find this issue. You should confirm the kernel is
returning a AF_INET6 socket type, if it is AF_INET then there is a
path I missed in 299ee and I should fix it..
Specifically, the corruption I confirmed was from a recvmsg call with
MSG_NOTIFICATION set indicating a new connection has happened on a
many to many socket.
strace sayth:
socket(PF_INET6, SOCK_SEQPACKET|SOCK_CLOEXEC, IPPROTO_SCTP) = 7
recvmsg(7, {msg_name(28)={sa_family¯_INET6, sin6_port=htons(9090), inet_pton(AF_INET6, "::ffff:0.0.0.0", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, msg_iov(1)=[{"\1\200\0\0\24\0\0\0\4\0\0\0\0\0\0\0\17%\0\0", 1024}], msg_controllen=0, msg_flags=MSG_EOR|MSG_MORE}, MSG_DONTWAIT) = 20
Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Daniel Borkmann' <daniel@iogearbox.net>,
Neil Horman <nhorman@tuxdriver.com>,
"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
Vlad Yasevich <vyasevich@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket
Date: Wed, 27 May 2015 10:31:57 -0600 [thread overview]
Message-ID: <20150527163157.GA15041@obsidianresearch.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CB40D32@AcuExch.aculab.com>
On Wed, May 27, 2015 at 04:16:44PM +0000, David Laight wrote:
> From: Jason Gunthorpe
> > Sent: 27 May 2015 16:32
> > On Wed, May 27, 2015 at 10:11:22AM +0000, David Laight wrote:
> >
> > > In any case it looks like I can escape by turning off
> > > SCTP_I_WANT_MAPPED_V4_ADDR for kernels 3.17 through 4.0.
> >
> > Just be aware that option is unusable on kernels without 299ee.
> >
> > I fixed everything wrong I saw, but that doesn't mean it works
> > 100%. Honestly, I don't think anyone has ever used it.
>
> I'm now confused.
>
> I've just done a test using a 4.0.0-rc1 kernel.
> I'm binding an IPv6 listening socket and then connecting to it
> from 127.0.0.1.
> I don't know it I'm being given an IPv4 format address or a
> v6mapped one (I shorten the latter before tracing it) - but
> it contains 127.0.0.1 (not 0.0.0.0).
> (That is without changing any socket options.)
I don't know what your test does, but I used the same basic idea with
loopback to find this issue. You should confirm the kernel is
returning a AF_INET6 socket type, if it is AF_INET then there is a
path I missed in 299ee and I should fix it..
Specifically, the corruption I confirmed was from a recvmsg call with
MSG_NOTIFICATION set indicating a new connection has happened on a
many to many socket.
strace sayth:
socket(PF_INET6, SOCK_SEQPACKET|SOCK_CLOEXEC, IPPROTO_SCTP) = 7
recvmsg(7, {msg_name(28)={sa_family=AF_INET6, sin6_port=htons(9090), inet_pton(AF_INET6, "::ffff:0.0.0.0", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, msg_iov(1)=[{"\1\200\0\0\24\0\0\0\4\0\0\0\0\0\0\0\17%\0\0", 1024}], msg_controllen=0, msg_flags=MSG_EOR|MSG_MORE}, MSG_DONTWAIT) = 20
Jason
next prev parent reply other threads:[~2015-05-27 16:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 23:30 [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket Jason Gunthorpe
2015-05-26 23:30 ` Jason Gunthorpe
2015-05-27 8:11 ` Daniel Borkmann
2015-05-27 8:11 ` Daniel Borkmann
2015-05-27 9:06 ` David Laight
2015-05-27 9:34 ` Daniel Borkmann
2015-05-27 9:34 ` Daniel Borkmann
2015-05-27 10:11 ` David Laight
2015-05-27 15:32 ` Jason Gunthorpe
2015-05-27 15:32 ` Jason Gunthorpe
2015-05-27 16:16 ` David Laight
2015-05-27 16:31 ` Jason Gunthorpe [this message]
2015-05-27 16:31 ` Jason Gunthorpe
2015-05-27 16:41 ` David Laight
2015-05-27 17:04 ` Jason Gunthorpe
2015-05-27 17:04 ` Jason Gunthorpe
2015-05-28 8:58 ` David Laight
2015-05-27 14:06 ` Neil Horman
2015-05-27 14:06 ` Neil Horman
2015-05-27 18:17 ` David Miller
2015-05-27 18:17 ` 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=20150527163157.GA15041@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=David.Laight@ACULAB.COM \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vyasevich@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.