From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org,
Xin Long <lucien.xin@gmail.com>,
Pietro Borrello <borrello@diag.uniroma1.it>
Subject: Re: [PATCH net] sctp: fail if no bound addresses can be used for a given scope
Date: Tue, 24 Jan 2023 23:30:22 -0300 [thread overview]
Message-ID: <Y9CUPsuuYgdr/g+s@t14s.localdomain> (raw)
In-Reply-To: <20230124181416.6218adb7@kernel.org>
On Tue, Jan 24, 2023 at 06:14:16PM -0800, Jakub Kicinski wrote:
> On Mon, 23 Jan 2023 14:59:33 -0300 Marcelo Ricardo Leitner wrote:
> > Currently, if you bind the socket to something like:
> > servaddr.sin6_family = AF_INET6;
> > servaddr.sin6_port = htons(0);
> > servaddr.sin6_scope_id = 0;
> > inet_pton(AF_INET6, "::1", &servaddr.sin6_addr);
> >
> > And then request a connect to:
> > connaddr.sin6_family = AF_INET6;
> > connaddr.sin6_port = htons(20000);
> > connaddr.sin6_scope_id = if_nametoindex("lo");
> > inet_pton(AF_INET6, "fe88::1", &connaddr.sin6_addr);
> >
> > What the stack does is:
> > - bind the socket
> > - create a new asoc
> > - to handle the connect
> > - copy the addresses that can be used for the given scope
> > - try to connect
> >
> > But the copy returns 0 addresses, and the effect is that it ends up
> > trying to connect as if the socket wasn't bound, which is not the
> > desired behavior. This unexpected behavior also allows KASLR leaks
> > through SCTP diag interface.
> >
> > The fix here then is, if when trying to copy the addresses that can
> > be used for the scope used in connect() it returns 0 addresses, bail
> > out. This is what TCP does with a similar reproducer.
> >
> > Reported-by: Pietro Borrello <borrello@diag.uniroma1.it>
> > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
>
> Fixes tag?
Lost in Narnia again, I suppose. :)
Ok, I had forgot it, but now checking, it predates git.
What should I have used in this case again please? Perhaps just:
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
next prev parent reply other threads:[~2023-01-25 2:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 17:59 [PATCH net] sctp: fail if no bound addresses can be used for a given scope Marcelo Ricardo Leitner
2023-01-23 19:57 ` Xin Long
2023-01-25 2:14 ` Jakub Kicinski
2023-01-25 2:30 ` Marcelo Ricardo Leitner [this message]
2023-01-25 2:32 ` Jakub Kicinski
2023-01-25 2:33 ` Marcelo Ricardo Leitner
2023-01-25 2:40 ` patchwork-bot+netdevbpf
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=Y9CUPsuuYgdr/g+s@t14s.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=borrello@diag.uniroma1.it \
--cc=kuba@kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.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