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:   Tue, 29 Nov 2016 20:53:35 +0800
From:   Pan Bian <bianpan2016@....com>
To:     Johan Hovold <johan@...nel.org>, linux-usb@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, Pan Bian <bianpan2016@....com>
Subject: [PATCH 1/1] usb: abort on exception path

Function klsi_105_open() calls usb_control_msg() and checks its return
value. When the return value is unexpected, it only assigns the error
code to the return variable retval, but does not terminate the exception
path. This patch fixes the bug by inserting "goto exit;" when the call
to usb_control_msg() fails.

Signed-off-by: Pan Bian <bianpan2016@....com>
---
 drivers/usb/serial/kl5kusb105.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index fc5d3a7..068919f 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -311,6 +311,7 @@ static int  klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (rc < 0) {
 		dev_err(&port->dev, "Enabling read failed (error = %d)\n", rc);
 		retval = rc;
+		goto exit;
 	} else
 		dev_dbg(&port->dev, "%s - enabled reading\n", __func__);
 
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ