Skip to content

Commit de0920b

Browse files
Dan Carpentergregkh
authored andcommitted
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>
1 parent 43664e1 commit de0920b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/staging/vt6655/ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
296296
}
297297
else {
298298
sLinkStatus.bLink = false;
299+
sLinkStatus.uLinkRate = 0;
299300
}
300301
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
301302
result = -EFAULT;

‎drivers/staging/vt6656/ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
291291
}
292292
else {
293293
sLinkStatus.bLink = FALSE;
294+
sLinkStatus.uLinkRate = 0;
294295
}
295296
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
296297
result = -EFAULT;

0 commit comments

Comments
 (0)