From: David Miller <davem@davemloft.net>
To: glider@google.com
Cc: dvyukov@google.com, kcc@google.com, edumazet@google.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v4] net: don't call strlen() on the user buffer in packet_bind_spkt()
Date: Wed, 01 Mar 2017 20:57:52 -0800 (PST) [thread overview]
Message-ID: <20170301.205752.2006881054868352173.davem@davemloft.net> (raw)
In-Reply-To: <20170301115720.99985-1-glider@google.com>
From: Alexander Potapenko <glider@google.com>
Date: Wed, 1 Mar 2017 12:57:20 +0100
> KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of
> uninitialized memory in packet_bind_spkt():
...
> This happens because addr.sa_data copied from the userspace is not
> zero-terminated, and copying it with strlcpy() in packet_bind_spkt()
> results in calling strlen() on the kernel copy of that non-terminated
> buffer.
>
> Signed-off-by: Alexander Potapenko <glider@google.com>
> ---
> Changes since v3:
> - addressed comments by Eric Dumazet (avoid using constants,
> use memcpy() instead of strncpy())
Applied and queued up for -stable.
next prev parent reply other threads:[~2017-03-02 6:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 11:57 Alexander Potapenko
2017-03-01 15:48 ` Eric Dumazet
2017-03-02 4:57 ` David Miller [this message]
2017-03-02 5:13 ` Cong Wang
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=20170301.205752.2006881054868352173.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dvyukov@google.com \
--cc=edumazet@google.com \
--cc=glider@google.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®