[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 6 Jun 2017 23:57:35 +0200
From: Florian Westphal <fw@...len.de>
To: David Miller <davem@...emloft.net>
Cc: glider@...gle.com, dvyukov@...gle.com, kcc@...gle.com,
edumazet@...gle.com, stephen@...workplumber.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v4] net: don't call strlen on non-terminated string in
dev_set_alias()
David Miller <davem@...emloft.net> wrote:
> From: Alexander Potapenko <glider@...gle.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@...gle.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.
Powered by blists - more mailing lists