stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings" has been added to the 4.2-stable tree
@ 2015-10-23  0:48 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-10-23  0:48 UTC (permalink / raw)
  To: joe, ben, davem, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings

to the 4.2-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:
     ethtool-use-kcalloc-instead-of-kmalloc-for-ethtool_get_strings.patch
and it can be found in the queue-4.2 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 Oct 22 17:25:24 PDT 2015
From: Joe Perches <joe@perches.com>
Date: Wed, 14 Oct 2015 01:09:40 -0700
Subject: ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings

From: Joe Perches <joe@perches.com>

[ Upstream commit 077cb37fcf6f00a45f375161200b5ee0cd4e937b ]

It seems that kernel memory can leak into userspace by a
kmalloc, ethtool_get_strings, then copy_to_user sequence.

Avoid this by using kcalloc to zero fill the copied buffer.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/ethtool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1284,7 +1284,7 @@ static int ethtool_get_strings(struct ne
 
 	gstrings.len = ret;
 
-	data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
+	data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER);
 	if (!data)
 		return -ENOMEM;
 


Patches currently in stable-queue which might be from joe@perches.com are

queue-4.2/ethtool-use-kcalloc-instead-of-kmalloc-for-ethtool_get_strings.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-23  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-23  0:48 Patch "ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings" has been added to the 4.2-stable tree gregkh

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).