* Patch "net: don't call strlen on non-terminated string in dev_set_alias()" has been added to the 4.4-stable tree
@ 2017-06-29 17:44 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-06-29 17:44 UTC (permalink / raw)
To: glider, davem, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
net: don't call strlen on non-terminated string in dev_set_alias()
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-don-t-call-strlen-on-non-terminated-string-in-dev_set_alias.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Thu Jun 29 19:38:17 CEST 2017
From: Alexander Potapenko <glider@google.com>
Date: Tue, 6 Jun 2017 15:56:54 +0200
Subject: net: don't call strlen on non-terminated string in dev_set_alias()
From: Alexander Potapenko <glider@google.com>
[ Upstream commit c28294b941232931fbd714099798eb7aa7e865d7 ]
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1246,8 +1246,9 @@ int dev_set_alias(struct net_device *dev
if (!new_ifalias)
return -ENOMEM;
dev->ifalias = new_ifalias;
+ memcpy(dev->ifalias, alias, len);
+ dev->ifalias[len] = 0;
- strlcpy(dev->ifalias, alias, len+1);
return len;
}
Patches currently in stable-queue which might be from glider@google.com are
queue-4.4/net-don-t-call-strlen-on-non-terminated-string-in-dev_set_alias.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-29 17:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 17:44 Patch "net: don't call strlen on non-terminated string in dev_set_alias()" has been added to the 4.4-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.