summaryrefslogtreecommitdiffstats
path: root/drivers/video/via/ioctl.c
diff options
context:
space:
mode:
authorDan Rosenberg <drosenberg@vsecurity.com>2010-09-16 01:08:24 +0200
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-09-16 01:43:53 +0200
commitb4aaa78f4c2f9cde2f335b14f4ca30b01f9651ca (patch)
treedb374bec1bf1ee1530b31d40ee4d6ff59819ca89 /drivers/video/via/ioctl.c
parentdrivers/video/via/via-gpio.c: fix warning (diff)
downloadlinux-b4aaa78f4c2f9cde2f335b14f4ca30b01f9651ca.tar.xz
linux-b4aaa78f4c2f9cde2f335b14f4ca30b01f9651ca.zip
drivers/video/via/ioctl.c: prevent reading uninitialized stack memory
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>
Diffstat (limited to '')
-rw-r--r--drivers/video/via/ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/via/ioctl.c b/drivers/video/via/ioctl.c
index da03c074e32a..4d553d0b8d7a 100644
--- a/drivers/video/via/ioctl.c
+++ b/drivers/video/via/ioctl.c
@@ -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;