Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1659322

Re: [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias()

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias()
Date 2017-06-07 03:10 +0200
Message-ID <tPxDX-86Y-1@gated-at.bofh.it> (permalink)
References <tPnEC-1x7-19@gated-at.bofh.it> <tPtqF-5fp-5@gated-at.bofh.it> <tPuG5-5Y4-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Florian Westphal <fw@strlen.de>
Date: Tue, 6 Jun 2017 23:57:35 +0200

> David Miller <davem@davemloft.net> wrote:
>> 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.
> 
> Unfortunately NLA_STRING doesn't check for NUL byte, only
> NLA_NUL_STRING does this.
> 
> So unless you think we can change kernel and make NLA_STRING
> behave like NLA_NUL_STRING I think patch is correct.

Ok, I missed that, thanks for the clarification.

I'll apply this and queue it up for -stable, thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias() Alexander Potapenko <glider@google.com> - 2017-06-06 16:30 +0200
  Re: [PATCH v4] net: don't call strlen on non-terminated string in  dev_set_alias() David Miller <davem@davemloft.net> - 2017-06-06 22:40 +0200
    Re: [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias() Alexander Potapenko <glider@google.com> - 2017-06-06 23:20 +0200
    Re: [PATCH v4] net: don't call strlen on non-terminated string in  dev_set_alias() Florian Westphal <fw@strlen.de> - 2017-06-07 00:00 +0200
      Re: [PATCH v4] net: don't call strlen on non-terminated string in  dev_set_alias() David Miller <davem@davemloft.net> - 2017-06-07 03:10 +0200

csiph-web