drivers/media/video/ivtv/ivtvfb.c: prevent reading uninitialized stack memory
PATCH 1/1 drivers/media/video/ivtv/ivtvfb.c: prevent reading uninitialized stack memory
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 <[email protected]>
drivers/media/video/ivtv/ivtvfb.c +2 -0
@@ -458,6 +458,8 @@ static int ivtvfb_ioctl(struct fb_info *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 (IVTV_REG_DEC_LINE_FIELD ) >>16 ;