Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1254846
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.14 09/25] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings |
| Date | 2015-10-23 20:20 +0200 |
| Message-ID | <qmP6B-Po-73@gated-at.bofh.it> (permalink) |
| References | <qmONc-d5-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
3.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 @@ -1080,7 +1080,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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 3.14 00/25] 3.14.56-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 02/25] af_unix: Convert the unix_sk macro to an inline function for type safety Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 24/25] sched/preempt: Rename PREEMPT_CHECK_OFFSET to PREEMPT_DISABLE_OFFSET Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 14/25] btrfs: fix use after free iterating extrefs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 06/25] skbuff: Fix skb checksum partial check. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 15/25] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 16/25] i2c: rcar: enable RuntimePM before registering to the core Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 25/25] sched/preempt: Fix cond_resched_lock() and cond_resched_softirq() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 05/25] skbuff: Fix skb checksum flag on skb pull Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 [PATCH 3.14 09/25] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:20 +0200 Re: [PATCH 3.14 00/25] 3.14.56-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-10-23 23:10 +0200 Re: [PATCH 3.14 00/25] 3.14.56-stable review Guenter Roeck <linux@roeck-us.net> - 2015-10-24 04:10 +0200
csiph-web