From: David Miller <davem@davemloft.net>
To: glider@google.com
Cc: dvyukov@google.com, kcc@google.com, edumazet@google.com,
stephen@networkplumber.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias()
Date: Tue, 06 Jun 2017 16:36:39 -0400 (EDT) [thread overview]
Message-ID: <20170606.163639.1246601020260541080.davem@davemloft.net> (raw)
In-Reply-To: <20170606135654.111884-1-glider@google.com>
From: Alexander Potapenko <glider@google.com>
Date: Tue, 6 Jun 2017 15:56:54 +0200
> KMSAN reported a use of uninitialized memory in dev_set_alias(),
> which was caused by calling strlcpy() (which in turn called strlen())
> on the user-supplied non-terminated string.
>
> Signed-off-by: Alexander Potapenko <glider@google.com>
We should not be allowing non-NULL terminated strings for the
IFLA_IFALIAS attribute. It's defined as type NLA_STRING in
the ifla_policy[] array.
Please figure out why we aren't enforcing the attribute policy
properly, rather than adding a workaround.
Thanks.
next prev parent reply other threads:[~2017-06-06 20:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-06 13:56 [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias() Alexander Potapenko
2017-06-06 20:36 ` David Miller [this message]
2017-06-06 21:15 ` Alexander Potapenko
2017-06-06 21:57 ` Florian Westphal
2017-06-07 1:04 ` 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=20170606.163639.1246601020260541080.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 \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).