Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40570798 authored by Dan Rosenberg's avatar Dan Rosenberg Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: ivtvfb: 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: default avatarDan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: default avatarAndy Walls <awalls@md.metrocast.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fc00a1d9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -466,6 +466,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(IVTV_REG_DEC_LINE_FIELD) >> 16;