Skip to content

Commit b9b1134

Browse files
segoontorvalds
authored andcommitted
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 <segooon@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 19714a8 commit b9b1134

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎drivers/char/ppdev.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
613613

614614
case PPGETTIME:
615615
to_jiffies = pp->pdev->timeout;
616+
memset(&par_timeout, 0, sizeof(par_timeout));
616617
par_timeout.tv_sec = to_jiffies / HZ;
617618
par_timeout.tv_usec = (to_jiffies % (long)HZ) * (1000000/HZ);
618619
if (copy_to_user (argp, &par_timeout, sizeof(struct timeval)))

0 commit comments

Comments
 (0)