]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 15:35:15 +0000 (16:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 15:35:15 +0000 (16:35 +0100)
added patches:
usb-dummy-hcd-increase-max-number-of-devices-to-32.patch
usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch

queue-4.14/series [new file with mode: 0644]
queue-4.14/usb-dummy-hcd-increase-max-number-of-devices-to-32.patch [new file with mode: 0644]
queue-4.14/usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch [new file with mode: 0644]
queue-4.19/series [new file with mode: 0644]
queue-5.4/series [new file with mode: 0644]

diff --git a/queue-4.14/series b/queue-4.14/series
new file mode 100644 (file)
index 0000000..2cd6538
--- /dev/null
@@ -0,0 +1,2 @@
+usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch
+usb-dummy-hcd-increase-max-number-of-devices-to-32.patch
diff --git a/queue-4.14/usb-dummy-hcd-increase-max-number-of-devices-to-32.patch b/queue-4.14/usb-dummy-hcd-increase-max-number-of-devices-to-32.patch
new file mode 100644 (file)
index 0000000..534148d
--- /dev/null
@@ -0,0 +1,36 @@
+From 8442b02bf3c6770e0d7e7ea17be36c30e95987b6 Mon Sep 17 00:00:00 2001
+From: Andrey Konovalov <andreyknvl@google.com>
+Date: Mon, 21 Oct 2019 16:20:58 +0200
+Subject: USB: dummy-hcd: increase max number of devices to 32
+
+From: Andrey Konovalov <andreyknvl@google.com>
+
+commit 8442b02bf3c6770e0d7e7ea17be36c30e95987b6 upstream.
+
+When fuzzing the USB subsystem with syzkaller, we currently use 8 testing
+processes within one VM. To isolate testing processes from one another it
+is desirable to assign a dedicated USB bus to each of those, which means
+we need at least 8 Dummy UDC/HCD devices.
+
+This patch increases the maximum number of Dummy UDC/HCD devices to 32
+(more than 8 in case we need more of them in the future).
+
+Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
+Link: https://lore.kernel.org/r/665578f904484069bb6100fb20283b22a046ad9b.1571667489.git.andreyknvl@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/udc/dummy_hcd.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/gadget/udc/dummy_hcd.c
++++ b/drivers/usb/gadget/udc/dummy_hcd.c
+@@ -2734,7 +2734,7 @@ static struct platform_driver dummy_hcd_
+ };
+ /*-------------------------------------------------------------------------*/
+-#define MAX_NUM_UDC   2
++#define MAX_NUM_UDC   32
+ static struct platform_device *the_udc_pdev[MAX_NUM_UDC];
+ static struct platform_device *the_hcd_pdev[MAX_NUM_UDC];
diff --git a/queue-4.14/usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch b/queue-4.14/usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch
new file mode 100644 (file)
index 0000000..5484dbd
--- /dev/null
@@ -0,0 +1,62 @@
+From 6dabeb891c001c592645df2f477fed9f5d959987 Mon Sep 17 00:00:00 2001
+From: Andrey Konovalov <andreyknvl@google.com>
+Date: Mon, 21 Oct 2019 16:20:59 +0200
+Subject: USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein
+
+From: Andrey Konovalov <andreyknvl@google.com>
+
+commit 6dabeb891c001c592645df2f477fed9f5d959987 upstream.
+
+Commit fea3409112a9 ("USB: add direction bit to urb->transfer_flags") has
+added a usb_urb_dir_in() helper function that can be used to determine
+the direction of the URB. With that patch USB_DIR_IN control requests with
+wLength == 0 are considered out requests by real USB HCDs. This patch
+changes dummy-hcd to use the usb_urb_dir_in() helper to match that
+behavior.
+
+Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
+Link: https://lore.kernel.org/r/4ae9e68ebca02f08a93ac61fe065057c9a01f0a8.1571667489.git.andreyknvl@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/udc/dummy_hcd.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/gadget/udc/dummy_hcd.c
++++ b/drivers/usb/gadget/udc/dummy_hcd.c
+@@ -1325,7 +1325,7 @@ static int dummy_perform_transfer(struct
+       u32 this_sg;
+       bool next_sg;
+-      to_host = usb_pipein(urb->pipe);
++      to_host = usb_urb_dir_in(urb);
+       rbuf = req->req.buf + req->req.actual;
+       if (!urb->num_sgs) {
+@@ -1413,7 +1413,7 @@ top:
+               /* FIXME update emulated data toggle too */
+-              to_host = usb_pipein(urb->pipe);
++              to_host = usb_urb_dir_in(urb);
+               if (unlikely(len == 0))
+                       is_short = 1;
+               else {
+@@ -1837,7 +1837,7 @@ restart:
+               /* find the gadget's ep for this request (if configured) */
+               address = usb_pipeendpoint (urb->pipe);
+-              if (usb_pipein(urb->pipe))
++              if (usb_urb_dir_in(urb))
+                       address |= USB_DIR_IN;
+               ep = find_endpoint(dum, address);
+               if (!ep) {
+@@ -2390,7 +2390,7 @@ static inline ssize_t show_urb(char *buf
+                       s = "?";
+                       break;
+                } s; }),
+-              ep, ep ? (usb_pipein(urb->pipe) ? "in" : "out") : "",
++              ep, ep ? (usb_urb_dir_in(urb) ? "in" : "out") : "",
+               ({ char *s; \
+               switch (usb_pipetype(urb->pipe)) { \
+               case PIPE_CONTROL: \
diff --git a/queue-4.19/series b/queue-4.19/series
new file mode 100644 (file)
index 0000000..2cd6538
--- /dev/null
@@ -0,0 +1,2 @@
+usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch
+usb-dummy-hcd-increase-max-number-of-devices-to-32.patch
diff --git a/queue-5.4/series b/queue-5.4/series
new file mode 100644 (file)
index 0000000..52e359c
--- /dev/null
@@ -0,0 +1 @@
+usb-dummy-hcd-use-usb_urb_dir_in-instead-of-usb_pipein.patch