From: David Miller <davem@davemloft.net>
To: ebiederm@xmission.com
Cc: keescook@chromium.org, eric.dumazet@gmail.com, kcc@google.com,
andreyknvl@google.com, edumazet@google.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
security@kernel.org, glider@google.com,
linux-sctp@vger.kernel.org, nhorman@tuxdriver.com,
vyasevich@gmail.com
Subject: Re: [PATCH net] net/sctp: Always set scope_id in sctp_inet6_skb_msgname
Date: Thu, 16 Nov 2017 23:00:26 +0900 (KST) [thread overview]
Message-ID: <20171116.230026.45581437273132607.davem@davemloft.net> (raw)
In-Reply-To: <871skyzwk3.fsf_-_@xmission.com>
From: ebiederm@xmission.com (Eric W. Biederman)
Date: Wed, 15 Nov 2017 22:17:48 -0600
>
> Alexandar Potapenko while testing the kernel with KMSAN and syzkaller
> discovered that in some configurations sctp would leak 4 bytes of
> kernel stack.
>
> Working with his reproducer I discovered that those 4 bytes that
> are leaked is the scope id of an ipv6 address returned by recvmsg.
>
> With a little code inspection and a shrewd guess I discovered that
> sctp_inet6_skb_msgname only initializes the scope_id field for link
> local ipv6 addresses to the interface index the link local address
> pertains to instead of initializing the scope_id field for all ipv6
> addresses.
>
> That is almost reasonable as scope_id's are meaniningful only for link
> local addresses. Set the scope_id in all other cases to 0 which is
> not a valid interface index to make it clear there is nothing useful
> in the scope_id field.
>
> There should be no danger of breaking userspace as the stack leak
> guaranteed that previously meaningless random data was being returned.
>
> Fixes: 372f525b495c ("SCTP: Resync with LKSCTP tree.")
> History-tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
> Reported-by: Alexander Potapenko <glider@google.com>
> Tested-by: Alexander Potapenko <glider@google.com>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Applied and queued up for -stable, thanks Eric.
next prev parent reply other threads:[~2017-11-16 14:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 16:14 [PATCH] net: recvmsg: Unconditionally zero struct sockaddr_storage Kees Cook
2017-10-31 17:31 ` Eric Dumazet
2017-11-01 12:48 ` Eric W. Biederman
2017-11-01 18:23 ` Kees Cook
2017-11-15 8:22 ` Alexander Potapenko
2017-11-16 4:17 ` [PATCH net] net/sctp: Always set scope_id in sctp_inet6_skb_msgname Eric W. Biederman
2017-11-16 14:00 ` David Miller [this message]
2017-11-15 2:13 ` [PATCH] net: recvmsg: Unconditionally zero struct sockaddr_storage Kees Cook
2017-11-15 18:37 ` Eric W. Biederman
2017-10-31 17:35 ` Ben Hutchings
2017-11-01 6:49 ` Willy Tarreau
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=20171116.230026.45581437273132607.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andreyknvl@google.com \
--cc=ebiederm@xmission.com \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=glider@google.com \
--cc=kcc@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=security@kernel.org \
--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 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).