lkml.org 
[lkml]   [2017]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias()
From
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.

\
 
 \ /
  Last update: 2017-06-12 00:54    [W:0.078 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site