Skip to contentSkip to conversation

patch "USB: usbdevfs: restore warning for nonsensical flags" added to usb-linus

PATCH [email protected] 1 participant 1 message Sep 20, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: usbdevfs: restore warning for nonsensical flags

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 81e0403b26d94360abd1f6a57311337973bc82cd Mon Sep 17 00:00:00 2001

From: Oliver Neukum <[email protected]>
Date: Wed, 5 Sep 2018 12:07:03 +0200
Subject: USB: usbdevfs: restore warning for nonsensical flags

If we filter flags before they reach the core we need to generate our own warnings.

Fixes 0cb54a3e47cb ("USB: debugging code shouldn't alter control flow")
Cc stable <[email protected]>
---
 drivers/usb/core/devio.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/core/devio.c +5 -0
index 263dd2f309fb..244417d0dfd1 100644
@@ -1697,6 +1697,11 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
 		u |= URB_NO_INTERRUPT;
 	as->urb->transfer_flags = u;
 
+	if (!allow_short && uurb->flags & USBDEVFS_URB_SHORT_NOT_OK)
+		dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_SHORT_NOT_OK.\n");
+	if (!allow_zero && uurb->flags & USBDEVFS_URB_ZERO_PACKET)
+		dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_ZERO_PACKET.\n");
+
 	as->urb->transfer_buffer_length = uurb->buffer_length;
 	as->urb->setup_packet = (unsigned char *)dr;
 	dr = NULL;
Signature · 1 line
2.19.0