diff options
author | Dan Rosenberg <drosenberg@vsecurity.com> | 2010-09-15 11:43:28 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-26 17:18:17 -0700 |
commit | 9df2a1a9348fe1098e55ca3899963a60419c12d8 (patch) | |
tree | 814dee76d61edc6f85139399f83b8a047181413a /drivers | |
parent | df7b44d7704fd1a1f3f6af399587bc15732490b0 (diff) |
drivers/net/usb/hso.c: prevent reading uninitialized memory
commit 7011e660938fc44ed86319c18a5954e95a82ab3e upstream.
Fixed formatting (tabs and line breaks).
The TIOCGICOUNT device ioctl allows unprivileged users to read
uninitialized stack memory, because the "reserved" member of the
serial_icounter_struct struct declared on the stack in hso_get_count()
is not altered or zeroed before being copied back to the user. This
patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/hso.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 4dd23513c5a..e2542742261 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -1653,6 +1653,8 @@ static int hso_get_count(struct hso_serial *serial, struct uart_icount cnow; struct hso_tiocmget *tiocmget = serial->tiocmget; + memset(&icount, 0, sizeof(struct serial_icounter_struct)); + if (!tiocmget) return -ENOENT; spin_lock_irq(&serial->serial_lock); |