From: Vasiliy Kulikov Date: Wed, 27 Oct 2010 22:34:21 +0000 (-0700) Subject: drivers/char/ppdev.c: fix information leak to userland X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b9b1134260e036fb75c468514569864dd6722f3e;p=openwrt%2Fstaging%2Fblogic.git drivers/char/ppdev.c: fix information leak to userland Structure par_timeout is copied to userland with some padding fields unitialized. Field tv_usec has type __kernel_suseconds_t, it differs from tv_sec's type on some architectures. It leads to leaking of stack memory. Signed-off-by: Vasiliy Kulikov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 723152d978a9..f176dbaeb15a 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -613,6 +613,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case PPGETTIME: to_jiffies = pp->pdev->timeout; + memset(&par_timeout, 0, sizeof(par_timeout)); par_timeout.tv_sec = to_jiffies / HZ; par_timeout.tv_usec = (to_jiffies % (long)HZ) * (1000000/HZ); if (copy_to_user (argp, &par_timeout, sizeof(struct timeval)))