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-prev] [day] [month] [year] [list]
Date:	Wed, 16 Feb 2011 00:24:29 +0530
From:	Amit Shah <amitshah@....net>
To:	Jiri Slaby <jirislaby@...il.com>
Cc:	Sergei Shtylyov <sshtylyov@...sta.com>,
	Jiri Slaby <jslaby@...e.cz>, gregkh@...e.de,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] USB: serial/usb_wwan, fix tty NULL dereference

On (Tue) 15 Feb 2011 [19:36:28], Jiri Slaby wrote:
> > If you're fixing that, might as well return in the 'if' above
> 
> No, the urb has to be resubmitted.

Ah; I meant the following, but it hardly matters..

diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index b004b2a..ad89228 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -293,25 +293,24 @@ static void usb_wwan_indat_callback(struct urb *urb)
 	if (status) {
 		dbg("%s: nonzero status: %d on endpoint %02x.",
 		    __func__, status, endpoint);
-	} else {
-		tty = tty_port_tty_get(&port->port);
-		if (urb->actual_length) {
-			tty_insert_flip_string(tty, data, urb->actual_length);
-			tty_flip_buffer_push(tty);
-		} else
-			dbg("%s: empty read urb received", __func__);
-		tty_kref_put(tty);
-
-		/* Resubmit urb so we continue receiving */
-		if (status != -ESHUTDOWN) {
-			err = usb_submit_urb(urb, GFP_ATOMIC);
-			if (err && err != -EPERM)
-				printk(KERN_ERR "%s: resubmit read urb failed. "
-				       "(%d)", __func__, err);
-			else
-				usb_mark_last_busy(port->serial->dev);
-		}
-
+		return;
+	}
+	tty = tty_port_tty_get(&port->port);
+	if (urb->actual_length) {
+		tty_insert_flip_string(tty, data, urb->actual_length);
+		tty_flip_buffer_push(tty);
+	} else
+		dbg("%s: empty read urb received", __func__);
+	tty_kref_put(tty);
+
+	/* Resubmit urb so we continue receiving */
+	if (status != -ESHUTDOWN) {
+		err = usb_submit_urb(urb, GFP_ATOMIC);
+		if (err && err != -EPERM)
+			printk(KERN_ERR "%s: resubmit read urb failed. "
+			       "(%d)", __func__, err);
+		else
+			usb_mark_last_busy(port->serial->dev);
 	}
 }
 

		Amit
-- 
http://log.amitshah.net/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ