drivers/video/via/ioctl.c: prevent reading uninitialized stack memory
authorDan Rosenberg <drosenberg@vsecurity.com>
Wed, 15 Sep 2010 23:08:24 +0000 (19:08 -0400)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Wed, 15 Sep 2010 23:43:53 +0000 (23:43 +0000)
The VIAFB_GET_INFO device ioctl allows unprivileged users to read 246
bytes of uninitialized stack memory, because the "reserved" member of
the viafb_ioctl_info struct declared on the stack is not altered or
zeroed before being copied back to the user.  This patch takes care of
it.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/via/ioctl.c

index da03c07..4d553d0 100644 (file)
@@ -25,6 +25,8 @@ int viafb_ioctl_get_viafb_info(u_long arg)
 {
        struct viafb_ioctl_info viainfo;
 
+       memset(&viainfo, 0, sizeof(struct viafb_ioctl_info));
+
        viainfo.viafb_id = VIAID;
        viainfo.vendor_id = PCI_VIA_VENDOR_ID;