]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: vt6655-6: potential info leak in private_ioctl()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Sep 2011 06:23:22 +0000 (09:23 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 27 Sep 2011 00:43:44 +0000 (17:43 -0700)
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>
drivers/staging/vt6655/ioctl.c
drivers/staging/vt6656/ioctl.c

index 8cf88c3b68da3ab46129dee4e24b656a67033e09..43964a5e72a98edc826a400eb8dafbcb83090231 100644 (file)
@@ -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;
index cfe9c95d78074a076d80c1560751a1575fd65512..1cb9a7d0d8835b60d0323a57f149c3766af9def5 100644 (file)
@@ -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;