linux-stable/drivers
Alan Stern b0863f1927 USB: core: Fix incorrect pipe calculation in do_proc_control()
When the user submits a control URB via usbfs, the user supplies the
bRequestType value and the kernel uses it to compute the pipe value.
However, do_proc_control() performs this computation incorrectly in
the case where the bRequestType direction bit is set to USB_DIR_IN and
the URB's transfer length is 0: The pipe's direction is also set to IN
but it should be OUT, which is the direction the actual transfer will
use regardless of bRequestType.

Commit 5cc59c418f ("USB: core: WARN if pipe direction != setup
packet direction") added a check to compare the direction bit in the
pipe value to a control URB's actual direction and to WARN if they are
different.  This can be triggered by the incorrect computation
mentioned above, as found by syzbot.

This patch fixes the computation, thus avoiding the WARNing.

Reported-and-tested-by: syzbot+72af3105289dcb4c055b@syzkaller.appspotmail.com
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20210712185436.GB326369@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-12 20:59:40 +02:00
..
accessibility
acpi More ACPI updates for 5.14-rc1 2021-07-07 13:30:01 -07:00
amba
android
ata ARM: SoC changes for 5.14 2021-07-10 09:22:44 -07:00
atm
auxdisplay
base More power management updates for 5.14-rc1 2021-07-07 13:22:59 -07:00
bcma
block block-5.14-2021-07-08 2021-07-09 12:05:33 -07:00
bluetooth
bus ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
cdrom
char ARM: SoC changes for 5.14 2021-07-10 09:22:44 -07:00
clk The second batch of clk driver code for -rc1 2021-07-08 12:12:22 -07:00
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto ARM: SoC changes for 5.14 2021-07-10 09:22:44 -07:00
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
fpga
fsi
gnss
gpio
gpu drm fixes for 5.14-rc1 2021-07-08 12:28:15 -07:00
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c I3C for 5.14 2021-07-10 11:53:06 -07:00
idle
iio
infiniband
input This pull request contains the following changes for UML: 2021-07-09 10:19:13 -07:00
interconnect
iommu ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
ipack
irqchip irqchip fixes for 5.14, take #1 2021-07-09 15:35:13 +02:00
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc block-5.14-2021-07-08 2021-07-09 12:05:33 -07:00
most
mtd This pull request contains the following changes for UBIFS: 2021-07-09 10:10:47 -07:00
mux
net ARM: SoC changes for 5.14 2021-07-10 09:22:44 -07:00
nfc
ntb
nubus
nvdimm
nvme block-5.14-2021-07-08 2021-07-09 12:05:33 -07:00
nvmem
of
opp
parisc
parport
pci pci-v5.14-fixes-1 2021-07-10 11:57:57 -07:00
pcmcia
perf
phy
pinctrl
platform
pnp
power power supply and reset changes for the v5.14 series 2021-07-07 13:17:48 -07:00
powercap
pps
ps3
ptp
pwm pwm: Remove redundant assignment to pointer pwm 2021-07-07 21:43:32 +02:00
rapidio
ras
regulator
remoteproc remoteproc updates for v5.14 2021-07-07 10:50:03 -07:00
reset ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
rpmsg
rtc RTC for 5.14 2021-07-10 16:19:10 -07:00
s390 s390 updates for the 5.14 merge window #2 2021-07-10 10:46:14 -07:00
sbus
scsi SCSI misc on 20210711 2021-07-11 10:59:53 -07:00
sh
siox
slimbus
soc ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
soundwire
spi
spmi
ssb
staging
target block-5.14-2021-07-08 2021-07-09 12:05:33 -07:00
tc
tee
thermal - Add rk3568 sensor support (Finley Xiao) 2021-07-10 11:43:25 -07:00
thunderbolt
tty This pull request contains the following changes for UML: 2021-07-09 10:19:13 -07:00
uio
usb USB: core: Fix incorrect pipe calculation in do_proc_control() 2021-07-12 20:59:40 +02:00
vdpa vp_vdpa: allow set vq state to initial state after reset 2021-07-08 07:49:02 -04:00
vfio
vhost vdpa: support packed virtqueue for set/get_vq_state() 2021-07-08 07:49:01 -04:00
video This pull request contains the following changes for UML: 2021-07-09 10:19:13 -07:00
virt
virtio virtio,vhost,vdpa: features, fixes 2021-07-09 11:06:29 -07:00
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.14-rc1 tag 2021-07-07 12:57:46 -07:00
xen xen: branch for v5.14-rc1 2021-07-07 11:07:13 -07:00
zorro
Kconfig
Makefile