From: Vasiliy Kulikov Date: Wed, 27 Oct 2010 22:34:21 +0000 (-0700) Subject: drivers/char/applicom.c: fix information leak to userland X-Git-Tag: v2.6.37-rc1~85^2~44 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=19714a8af8fe8618a9beace1f7a3bb10d55d5e2f;p=net-next-2.6.git drivers/char/applicom.c: fix information leak to userland Structure st_loc is copied to userland with some fields unitialized. 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/applicom.c b/drivers/char/applicom.c index e7ba774beda..25373df1dcf 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -566,6 +566,7 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_ struct mailbox mailbox; /* Got a packet for us */ + memset(&st_loc, 0, sizeof(st_loc)); ret = do_ac_read(i, buf, &st_loc, &mailbox); spin_unlock_irqrestore(&apbs[i].mutex, flags); set_current_state(TASK_RUNNING);