提交 de0920b1 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

Staging: vt6655-6: potential info leak in private_ioctl()

Smatch has a new check for Rosenberg type information leaks where
structs are copied to the user with uninitialized stack data in them.

In this path, the .uLinkRate member doesn't get initialized so I've
set it to zero.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 43664e14
...@@ -296,6 +296,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { ...@@ -296,6 +296,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
} }
else { else {
sLinkStatus.bLink = false; sLinkStatus.bLink = false;
sLinkStatus.uLinkRate = 0;
} }
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) { if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
result = -EFAULT; result = -EFAULT;
......
...@@ -291,6 +291,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { ...@@ -291,6 +291,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
} }
else { else {
sLinkStatus.bLink = FALSE; sLinkStatus.bLink = FALSE;
sLinkStatus.uLinkRate = 0;
} }
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) { if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
result = -EFAULT; result = -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册