Sure, I believe SCTP crowd already know they are missing ipv6_dup_options()
$ git grep -n ipv6_dup_options
include/net/ipv6.h:300:struct ipv6_txoptions *ipv6_dup_options(struct sock *sk,
net/dccp/ipv6.c:499: opt = ipv6_dup_options(newsk, opt);
net/ipv6/exthdrs.c:714:ipv6_dup_options(struct sock *sk, struct
ipv6_txoptions *opt)
net/ipv6/exthdrs.c:734:EXPORT_SYMBOL_GPL(ipv6_dup_options);
net/ipv6/tcp_ipv6.c:1107: opt = ipv6_dup_options(newsk, opt);
I can certainly send a patch, but maybe someone already cooked it and
is testing it ?
Sure, I believe SCTP crowd already know they are missing ipv6_dup_options()
$ git grep -n ipv6_dup_options
include/net/ipv6.h:300:struct ipv6_txoptions *ipv6_dup_options(struct sock *sk,
net/dccp/ipv6.c:499: opt = ipv6_dup_options(newsk, opt);
net/ipv6/exthdrs.c:714:ipv6_dup_options(struct sock *sk, struct
ipv6_txoptions *opt)
net/ipv6/exthdrs.c:734:EXPORT_SYMBOL_GPL(ipv6_dup_options);
net/ipv6/tcp_ipv6.c:1107: opt = ipv6_dup_options(newsk, opt);
I can certainly send a patch, but maybe someone already cooked it and
is testing it ?
Speaking for me, I don't have it yet, at least not that fast. ;)
But I definitely can handle this, just please let me know. I'll be on
hold now. Thanks
Marcelo
From: Eric Dumazet <edumazet@google.com> Date: 2015-12-09 15:09:56
On Wed, Dec 9, 2015 at 6:59 AM, Marcelo Ricardo Leitner
[off-list ref] wrote:
On Wed, Dec 09, 2015 at 06:43:28AM -0800, Eric Dumazet wrote:
quoted
I can certainly send a patch, but maybe someone already cooked it and
is testing it ?
Speaking for me, I don't have it yet, at least not that fast. ;)
But I definitely can handle this, just please let me know. I'll be on
hold now. Thanks
From: Eric Dumazet <hidden> Date: 2015-12-09 15:25:15
From: Eric Dumazet <edumazet@google.com>
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same
in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/sctp/ipv6.c | 8 ++++++++
1 file changed, 8 insertions(+)
From: Eric Dumazet <edumazet@google.com>
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same
in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Vlad Yasevich <redacted>
This is sufficient for accept() processing, but looks like peeloff is missing
a bunch of ipv6 support. I'll see if I can cook something up to fix that part.
-vlad
From: David Laight <hidden> Date: 2015-12-09 15:51:28
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
I'm wondering what the real impact of this and the other recent
SCTP bugs/patches is on real workloads?
We have enough trouble getting our customers to use kernels
later that the 2.6.18 based RHEL5 - without having to persuade
them to use kernels that contain very recent fixes.
David
From: Eric Dumazet <hidden> Date: 2015-12-09 15:59:48
On Wed, 2015-12-09 at 15:49 +0000, David Laight wrote:
quoted
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
I'm wondering what the real impact of this and the other recent
SCTP bugs/patches is on real workloads?
We have enough trouble getting our customers to use kernels
later that the 2.6.18 based RHEL5 - without having to persuade
them to use kernels that contain very recent fixes.
It all depends if your customers let (hostile ?) people run programs on
the boxes.
I wont run the program on my laptop just for the fun of making it crash,
but I guess Cloud providers might be worried, once exploits are public.
From: David Laight <hidden> Date: 2015-12-09 16:33:48
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
Sent: 09 December 2015 16:00
On Wed, 2015-12-09 at 15:49 +0000, David Laight wrote:
quoted
quoted
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
I'm wondering what the real impact of this and the other recent
SCTP bugs/patches is on real workloads?
We have enough trouble getting our customers to use kernels
later that the 2.6.18 based RHEL5 - without having to persuade
them to use kernels that contain very recent fixes.
It all depends if your customers let (hostile ?) people run programs on
the boxes.
If they require hostile programs I'm not worried.
But it isn't entirely clear from these oops reports what the
test program is actually doing.
Some of them might be valid scenarios.
Not that our code does anything clever.
David
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
quoted
Sent: 09 December 2015 16:00
On Wed, 2015-12-09 at 15:49 +0000, David Laight wrote:
quoted
quoted
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
I'm wondering what the real impact of this and the other recent
SCTP bugs/patches is on real workloads?
We have enough trouble getting our customers to use kernels
later that the 2.6.18 based RHEL5 - without having to persuade
them to use kernels that contain very recent fixes.
It all depends if your customers let (hostile ?) people run programs on
the boxes.
If they require hostile programs I'm not worried.
Not really "require", but "allow", as in: allowing third-party
applications to run on it.
But it isn't entirely clear from these oops reports what the
test program is actually doing.
Some of them might be valid scenarios.
Not that our code does anything clever.
This one patched by Eric is a rather common scenario and can lead to
memory corruption and even double-frees because it will call txopt_put()
on a buffer that is long gone due to the blind pointer copy. Note that
Vlad is checking peeloff operation yet regarding this.
You just have to use the right SOL_IPV6 options and accept a socket to
trigger it.
The timestamps I patched are also not an unusual scenario and allow one
to be able to disable packet stamping for the entire system. Another
effect would be to one enable stamping on listening socket and not gett
it automatically on accepted ones, but that's probably a minor compared
to the others because developers probably would have caught this already.
And this last one I'm still fixing, is mostly harmless so far. The
use-after-free happens only in a debug statement (read: not propagated
anywhere else) and it's just a read.
HTH!
Marcelo
From: Daniel Borkmann <daniel@iogearbox.net> Date: 2015-12-09 19:19:53
On 12/09/2015 06:11 PM, Marcelo Ricardo Leitner wrote:
Em 09-12-2015 14:31, David Laight escreveu:
quoted
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
quoted
Sent: 09 December 2015 16:00
On Wed, 2015-12-09 at 15:49 +0000, David Laight wrote:
quoted
quoted
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
I'm wondering what the real impact of this and the other recent
SCTP bugs/patches is on real workloads?
We have enough trouble getting our customers to use kernels
later that the 2.6.18 based RHEL5 - without having to persuade
them to use kernels that contain very recent fixes.
It all depends if your customers let (hostile ?) people run programs on
the boxes.
If they require hostile programs I'm not worried.
Not really "require", but "allow", as in: allowing third-party applications to run on it.
Yeah :/ given distros enable almost everything anyway, the first unpriv'ed
socket(..., IPPROTO_SCTP) call auto-loads SCTP module. But to be honest, I'd
be surprised if Cloud providers allow for this. Most of this might only run
on dedicated boxes with telco appliances.
From: David Laight <hidden> Date: 2015-12-10 12:28:24
From: Daniel Borkmann
Sent: 09 December 2015 19:19
On 12/09/2015 06:11 PM, Marcelo Ricardo Leitner wrote:
quoted
Em 09-12-2015 14:31, David Laight escreveu:
quoted
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
quoted
Sent: 09 December 2015 16:00
On Wed, 2015-12-09 at 15:49 +0000, David Laight wrote:
quoted
quoted
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
I'm wondering what the real impact of this and the other recent
SCTP bugs/patches is on real workloads?
We have enough trouble getting our customers to use kernels
later that the 2.6.18 based RHEL5 - without having to persuade
them to use kernels that contain very recent fixes.
It all depends if your customers let (hostile ?) people run programs on
the boxes.
If they require hostile programs I'm not worried.
Not really "require", but "allow", as in: allowing third-party applications to run on it.
Yeah :/ given distros enable almost everything anyway, the first unpriv'ed
socket(..., IPPROTO_SCTP) call auto-loads SCTP module. But to be honest, I'd
be surprised if Cloud providers allow for this. Most of this might only run
on dedicated boxes with telco appliances.
Yes, I'm worried about whether our M3UA code is likely to crash customer
systems, not whether hostile applications can crash it.
These boxes ought to be on private networks since the sigtran protocols
themselves have nothing that even gives a hint of security.
David
From: Eric Dumazet <hidden> Date: 2015-12-10 15:58:23
On Thu, 2015-12-10 at 12:26 +0000, David Laight wrote:
Yes, I'm worried about whether our M3UA code is likely to crash customer
systems, not whether hostile applications can crash it.
These boxes ought to be on private networks since the sigtran protocols
themselves have nothing that even gives a hint of security.
As long as the listener socket is kept as is, meaning that the only use
of it is the poll()/select()/accept() system calls, you are safe.
The bug is about having a fuzzer, specifically playing games with multi
threads so that the listener ipv6 options are changed after accept().
This should not really happen in real world applications : If ipv6
options need to be set on listener, they are set before first accept()
is performed, and not unset until application exits and kill all
sessions.
BTW, are you even using IPv6 SCTP sessions ?
From: David Laight <hidden> Date: 2015-12-10 17:29:32
From: Eric Dumazet
Sent: 10 December 2015 15:58
BTW, are you even using IPv6 SCTP sessions ?
Our M3UA/SCTP protocol stack supports them and defaults to using
IPv6 listening sockets for IPv4 connections.
I very much doubt than any customers have used them yet.
So most of the IPv6 connections will have been to ::1
during internal regression testing.
We don't even try to set any IPv6 (or IPv4) options.
Just SO_REUSEADDR, TCP/SCTP_NODELAY, SCTP_EVENTS, SCTP_INITMSG,
SO_KEEPALIVE (tcp), IPV6_V6ONLY (if binding separate listeners),
SCTP_SOCKOPT_BINX_ADD (WTF is this a 'socket option') and
SO_LINGER (to get abortive close on SCTP connections on kernels
before 3.18).
David
From: David Miller <davem@davemloft.net> Date: 2015-12-12 01:19:21
From: Eric Dumazet <redacted>
Date: Wed, 09 Dec 2015 07:25:06 -0800
From: Eric Dumazet <edumazet@google.com>
SCTP is lacking proper np->opt cloning at accept() time.
TCP and DCCP use ipv6_dup_options() helper, do the same
in SCTP.
We might later factorize this code in a common helper to avoid
future mistakes.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>