Skip to content

Commit

Permalink
Staging: vt6655-6: potential info leak in private_ioctl()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Sep 27, 2011
1 parent 43664e1 commit de0920b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/vt6655/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vt6656/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit de0920b

Please sign in to comment.