lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  7 Mar 2018 12:23:56 -0800
From:   sathyanarayanan.kuppuswamy@...ux.intel.com
To:     gregkh@...uxfoundation.org, johan@...nel.org
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
Subject: [PATCH v1 1/1] USB: serial: Add boundry check for read_urbs array access

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>

In usb_serial_generic_submit_read_urb() function we are accessing the
port->read_urbs array without any boundry checks. This might lead to
kernel panic when index value goes above array length.

One posible call path for this issue is,

usb_serial_generic_read_bulk_callback()
{
 ...
 if (!port->throttled) {
	usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC);
 ...
}

This patch fixes this issue.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
---
 drivers/usb/serial/generic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 2274d96..72ebdde 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -306,6 +306,9 @@ static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
 {
 	int res;
 
+	if (index >= ARRAY_SIZE(port->read_urbs))
+		return -EINVAL;
+
 	if (!test_and_clear_bit(index, &port->read_urbs_free))
 		return 0;
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ