From: Greg Kroah-Hartman Date: Sat, 21 Dec 2013 18:10:00 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.76~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38255eb226ae7d8685a2c9e2c2613f3df2359f41;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: usb-serial-fix-race-in-generic-write.patch --- diff --git a/queue-3.4/series b/queue-3.4/series new file mode 100644 index 00000000000..f351a020bbc --- /dev/null +++ b/queue-3.4/series @@ -0,0 +1 @@ +usb-serial-fix-race-in-generic-write.patch diff --git a/queue-3.4/usb-serial-fix-race-in-generic-write.patch b/queue-3.4/usb-serial-fix-race-in-generic-write.patch new file mode 100644 index 00000000000..cb80fb6ef76 --- /dev/null +++ b/queue-3.4/usb-serial-fix-race-in-generic-write.patch @@ -0,0 +1,47 @@ +From 6f6485463aada1ec6a0f3db6a03eb8e393d6bb55 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Sat, 9 Nov 2013 12:38:09 +0100 +Subject: USB: serial: fix race in generic write + +From: Johan Hovold + +commit 6f6485463aada1ec6a0f3db6a03eb8e393d6bb55 upstream. + +Fix race in generic write implementation, which could lead to +temporarily degraded throughput. + +The current generic write implementation introduced by commit +27c7acf22047 ("USB: serial: reimplement generic fifo-based writes") has +always had this bug, although it's fairly hard to trigger and the +consequences are not likely to be noticed. + +Specifically, a write() on one CPU while the completion handler is +running on another could result in only one of the two write urbs being +utilised to empty the remainder of the write fifo (unless there is a +second write() that doesn't race during that time). + +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/generic.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +--- a/drivers/usb/serial/generic.c ++++ b/drivers/usb/serial/generic.c +@@ -223,14 +223,7 @@ retry: + return result; + } + +- /* Try sending off another urb, unless in irq context (in which case +- * there will be no free urb). */ +- if (!in_irq()) +- goto retry; +- +- clear_bit_unlock(USB_SERIAL_WRITE_BUSY, &port->flags); +- +- return 0; ++ goto retry; /* try sending off another urb */ + } + + /**