]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drivers/net/usb/hso.c: prevent reading uninitialized memory
authorDan Rosenberg <drosenberg@vsecurity.com>
Wed, 15 Sep 2010 11:43:28 +0000 (11:43 +0000)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 6 Jan 2011 23:07:58 +0000 (18:07 -0500)
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: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/net/usb/hso.c

index be0cc99e881a6c4c41c8b8f502d0392f4be343e5..0ba865e09033e2a4d01eb268d6b8b6cbc426d072 100644 (file)
@@ -1654,6 +1654,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);