提交 16858e7e 编写于 作者: A Avijit Kanti Das 提交者: Xie XiuQi

net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

mainline inclusion
from kernel/msm-3.10
commit 63c317dbee979830
category: bugfix
bugzilla: NA
CVE: CVE-2014-9900

---------------------------------------

memset() the structure ethtool_wolinfo that has padded bytes
but the padded bytes have not been zeroed out.
Signed-off-by: NAvijit Kanti Das <avijitnsec@codeaurora.org>
Link: https://source.codeaurora.org/quic/la/kernel/msm-3.10/commit/?id=63c317dbee97983004dffdd9f742a20d17150071
Link: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-9900Signed-off-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NHui Wang <john.wanghui@huawei.com>
Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: NZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: NMao Wenan <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2dc24b77
...@@ -1471,11 +1471,13 @@ static int ethtool_reset(struct net_device *dev, char __user *useraddr) ...@@ -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) 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) if (!dev->ethtool_ops->get_wol)
return -EOPNOTSUPP; return -EOPNOTSUPP;
memset(&wol, 0, sizeof(struct ethtool_wolinfo));
wol.cmd = ETHTOOL_GWOL;
dev->ethtool_ops->get_wol(dev, &wol); dev->ethtool_ops->get_wol(dev, &wol);
if (copy_to_user(useraddr, &wol, sizeof(wol))) if (copy_to_user(useraddr, &wol, sizeof(wol)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册