Skip to contentSkip to conversation

char: applicom: fix information leak to userland

PATCH In review Vasiliy Kulikov 1 participant 1 message Oct 17, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 char: applicom: fix information leak to userland

Structure st_loc is copied to userland with some fields unitialized. It leads to leaking of stack memory.

---
Compile tested.

 drivers/char/applicom.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/applicom.c +1 -0
index e7ba774..25373df 100644
@@ -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);
Signature · 1 line
1.7.0.4