From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:47423 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966034AbbJWAsG (ORCPT ); Thu, 22 Oct 2015 20:48:06 -0400 Subject: Patch "ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings" has been added to the 4.2-stable tree To: joe@perches.com, ben@decadent.org.uk, davem@davemloft.net, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 22 Oct 2015 17:48:05 -0700 Message-ID: <14455612851407@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From foo@baz Thu Oct 22 17:25:24 PDT 2015 From: Joe Perches Date: Wed, 14 Oct 2015 01:09:40 -0700 Subject: ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings From: Joe Perches [ 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 Acked-by: Ben Hutchings Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- 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