V4L/DVB: ivtvfb: prevent reading uninitialized stack memory
authorDan Rosenberg <drosenberg@vsecurity.com>
Wed, 15 Sep 2010 21:44:22 +0000 (18:44 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:27:10 +0000 (13:27 -0800)
commit 405707985594169cfd0b1d97d29fcb4b4c6f2ac9 upstream.

The FBIOGET_VBLANK device ioctl allows unprivileged users to read 16
bytes of uninitialized stack memory, because the "reserved" member of
the fb_vblank 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: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/ivtv/ivtvfb.c

index fa6bb85cb4b06ebf7626f5dd6557b9d345107bee..6b61bb67e9d1179c855b925099e9fc7d8720a604 100644 (file)
@@ -457,6 +457,8 @@ static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long ar
                        struct fb_vblank vblank;
                        u32 trace;
 
+                       memset(&vblank, 0, sizeof(struct fb_vblank));
+
                        vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT |
                                        FB_VBLANK_HAVE_VSYNC;
                        trace = read_reg(0x028c0) >> 16;