]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
authorJoe Perches <joe@perches.com>
Wed, 14 Oct 2015 08:09:40 +0000 (01:09 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 5 Dec 2015 23:49:16 +0000 (00:49 +0100)
commit62611261b1f4e93561adcedc919473481cebc2f4
treeed2af1f9c7f3e41e170fd84cb99417bd31b58b65
parent53bf8cef1e93ab5b356bb3122d2312fdfc74d979
ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings

[ 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: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 68c3e59aa9cdf2d8870d8fbe4f37b1a509d0abeb)

Signed-off-by: Willy Tarreau <w@1wt.eu>
net/core/ethtool.c