Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-01
STALE3745d

[PATCH] ethtool: fix a kernel infoleak in ethtool_get_pauseparam

From: Kangjie Lu <hidden>
Date: 2016-06-01 14:39:34
Also in: lkml
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help