From: Greg Kroah-Hartman Date: Thu, 9 May 2019 17:28:37 +0000 (+0200) Subject: drop broken 3.18 uas patch X-Git-Tag: v4.9.175~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ac173b7073badaa2529314e0d5c8c406d0c754a;p=thirdparty%2Fkernel%2Fstable-queue.git drop broken 3.18 uas patch --- diff --git a/queue-3.18/series b/queue-3.18/series index c4c36bface8..4b0ff198ad9 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -60,4 +60,3 @@ genirq-prevent-use-after-free-and-work-list-corrupti.patch scsi-qla2xxx-fix-incorrect-region-size-setting-in-optrom-sysfs-routines.patch bluetooth-hidp-fix-buffer-overflow.patch bluetooth-align-minimum-encryption-key-size-for-le-and-br-edr-connections.patch -uas-fix-alignment-of-scatter-gather-segments.patch diff --git a/queue-3.18/uas-fix-alignment-of-scatter-gather-segments.patch b/queue-3.18/uas-fix-alignment-of-scatter-gather-segments.patch deleted file mode 100644 index 81609a166c4..00000000000 --- a/queue-3.18/uas-fix-alignment-of-scatter-gather-segments.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 3ae62a42090f1ed48e2313ed256a1182a85fb575 Mon Sep 17 00:00:00 2001 -From: Oliver Neukum -Date: Tue, 30 Apr 2019 12:21:45 +0200 -Subject: UAS: fix alignment of scatter/gather segments - -From: Oliver Neukum - -commit 3ae62a42090f1ed48e2313ed256a1182a85fb575 upstream. - -This is the UAS version of - -747668dbc061b3e62bc1982767a3a1f9815fcf0e -usb-storage: Set virt_boundary_mask to avoid SG overflows - -We are not as likely to be vulnerable as storage, as it is unlikelier -that UAS is run over a controller without native support for SG, -but the issue exists. -The issue has been existing since the inception of the driver. - -Fixes: 115bb1ffa54c ("USB: Add UAS driver") -Signed-off-by: Oliver Neukum -Cc: stable -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/usb/storage/uas.c | 38 ++++++++++++++++++++++++-------------- - 1 file changed, 24 insertions(+), 14 deletions(-) - ---- a/drivers/usb/storage/uas.c -+++ b/drivers/usb/storage/uas.c -@@ -783,23 +783,33 @@ static int uas_slave_alloc(struct scsi_d - { - struct uas_dev_info *devinfo = - (struct uas_dev_info *)sdev->host->hostdata; -+ int maxp; - - sdev->hostdata = devinfo; - -- /* USB has unusual DMA-alignment requirements: Although the -- * starting address of each scatter-gather element doesn't matter, -- * the length of each element except the last must be divisible -- * by the Bulk maxpacket value. There's currently no way to -- * express this by block-layer constraints, so we'll cop out -- * and simply require addresses to be aligned at 512-byte -- * boundaries. This is okay since most block I/O involves -- * hardware sectors that are multiples of 512 bytes in length, -- * and since host controllers up through USB 2.0 have maxpacket -- * values no larger than 512. -- * -- * But it doesn't suffice for Wireless USB, where Bulk maxpacket -- * values can be as large as 2048. To make that work properly -- * will require changes to the block layer. -+ /* -+ * We have two requirements here. We must satisfy the requirements -+ * of the physical HC and the demands of the protocol, as we -+ * definitely want no additional memory allocation in this path -+ * ruling out using bounce buffers. -+ * -+ * For a transmission on USB to continue we must never send -+ * a package that is smaller than maxpacket. Hence the length of each -+ * scatterlist element except the last must be divisible by the -+ * Bulk maxpacket value. -+ * If the HC does not ensure that through SG, -+ * the upper layer must do that. We must assume nothing -+ * about the capabilities off the HC, so we use the most -+ * pessimistic requirement. -+ */ -+ -+ maxp = usb_maxpacket(devinfo->udev, devinfo->data_in_pipe, 0); -+ blk_queue_virt_boundary(sdev->request_queue, maxp - 1); -+ -+ /* -+ * The protocol has no requirements on alignment in the strict sense. -+ * Controllers may or may not have alignment restrictions. -+ * As this is not exported, we use an extremely conservative guess. - */ - blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); -