lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1572076456-12463-1-git-send-email-zhang.lin16@zte.com.cn>
Date:   Sat, 26 Oct 2019 15:54:16 +0800
From:   zhanglin <zhang.lin16@....com.cn>
To:     davem@...emloft.net
Cc:     ast@...nel.org, daniel@...earbox.net, jakub.kicinski@...ronome.com,
        hawk@...nel.org, john.fastabend@...il.com, mkubecek@...e.cz,
        jiri@...lanox.com, pablo@...filter.org, f.fainelli@...il.com,
        maxime.chevallier@...tlin.com, lirongqing@...du.com,
        vivien.didelot@...il.com, linyunsheng@...wei.com,
        natechancellor@...il.com, arnd@...db.de, dan.carpenter@...cle.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, xue.zhihong@....com.cn, wang.yi59@....com.cn,
        jiang.xuexin@....com.cn, zhanglin <zhang.lin16@....com.cn>
Subject: [PATCH] net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

memset() the structure ethtool_wolinfo that has padded bytes
but the padded bytes have not been zeroed out.

Signed-off-by: zhanglin <zhang.lin16@....com.cn>
---
 net/core/ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index aeabc48..563a845 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1471,11 +1471,13 @@ static int ethtool_reset(struct net_device *dev, char __user *useraddr)
 
 static int ethtool_get_wol(struct net_device *dev, char __user *useraddr)
 {
-	struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
+	struct ethtool_wolinfo wol;
 
 	if (!dev->ethtool_ops->get_wol)
 		return -EOPNOTSUPP;
 
+	memset(&wol, 0, sizeof(struct ethtool_wolinfo));
+	wol.cmd = ETHTOOL_GWOL;
 	dev->ethtool_ops->get_wol(dev, &wol);
 
 	if (copy_to_user(useraddr, &wol, sizeof(wol)))
-- 
2.15.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ