netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethtool: fix a kernel infoleak in ethtool_get_pauseparam
@ 2016-06-01 14:39 Kangjie Lu
  2016-06-01 14:57 ` Edward Cree
  2016-06-01 17:14 ` Ben Hutchings
  0 siblings, 2 replies; 3+ messages in thread
From: Kangjie Lu @ 2016-06-01 14:39 UTC (permalink / raw)
  To: davem; +Cc: ben, kan.liang, netdev, linux-kernel, taesoo, csong84, Kangjie Lu

The field autoneg of pauseparam is not initialized in some
implementations of get_pauseparam(), but the whole object is
copied to userland.

Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
---
 net/core/ethtool.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index f426c5a..84544bd 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1723,7 +1723,10 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
 
 static int ethtool_get_pauseparam(struct net_device *dev, void __user *useraddr)
 {
-	struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
+	struct ethtool_pauseparam pauseparam;
+
+	memset(&pauseparam, 0, sizeof(pauseparam));
+	pauseparam.cmd = ETHTOOL_GPAUSEPARAM;
 
 	if (!dev->ethtool_ops->get_pauseparam)
 		return -EOPNOTSUPP;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-01 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01 14:39 [PATCH] ethtool: fix a kernel infoleak in ethtool_get_pauseparam Kangjie Lu
2016-06-01 14:57 ` Edward Cree
2016-06-01 17:14 ` Ben Hutchings

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