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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Dan Carpenter 2011-09-23 09:23:22 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель 43664e14a0
Коммит de0920b1fe
2 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -296,6 +296,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
}
else {
sLinkStatus.bLink = false;
sLinkStatus.uLinkRate = 0;
}
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
result = -EFAULT;

Просмотреть файл

@ -291,6 +291,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
}
else {
sLinkStatus.bLink = FALSE;
sLinkStatus.uLinkRate = 0;
}
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
result = -EFAULT;