linux/drivers
ZiyangZhang e6190dd003 ublk_drv: do not add a re-issued request aborted previously to ioucmd's task_work
In ublk_queue_rq(), Assume current request is a re-issued request aborted
previously in monitor_work because the ubq_daemon(ioucmd's task) is
PF_EXITING. For this request, we cannot call
io_uring_cmd_complete_in_task() anymore because at that moment io_uring
context may be freed in case that no inflight ioucmd exists. Otherwise,
we may cause null-deref in ctx->fallback_work.

Add a check on UBLK_IO_FLAG_ABORTED to prevent the above situation. This
check is safe and makes sense.

Note: monitor_work sets UBLK_IO_FLAG_ABORTED and ends this request
(releasing the tag). Then the request is restarted(allocating the tag)
and we are here. Since releasing/allocating a tag implies smp_mb(),
finding UBLK_IO_FLAG_ABORTED guarantees that here is a re-issued request
aborted previously.

Suggested-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220815023633.259825-4-ZiyangZhang@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-08-16 06:16:19 -06:00
..
accessibility
acpi pci-v5.20-changes 2022-08-04 19:30:35 -07:00
amba ARM: 9220/1: amba: Remove deferred device addition 2022-07-28 15:09:23 +01:00
android
ata ATA changes for 5.20-rc1 2022-08-03 15:26:04 -07:00
atm
auxdisplay
base Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
bcma
block ublk_drv: do not add a re-issued request aborted previously to ioucmd's task_work 2022-08-16 06:16:19 -06:00
bluetooth SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
bus SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cdrom
char SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
clk The clk core gains a new set of APIs that allow drivers to both acquire clks 2022-08-04 18:40:08 -07:00
clocksource - Add the missing DT bindings for the MTU nomadik timer (Linus 2022-07-28 12:33:34 +02:00
comedi pci-v5.20-changes 2022-08-04 19:30:35 -07:00
connector
counter
cpufreq SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cpuidle SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
crypto This update includes the following changes: 2022-08-02 17:45:14 -07:00
cxl
dax
dca
devfreq Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
dio
dma pci-v5.20-changes 2022-08-04 19:30:35 -07:00
dma-buf drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
edac platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
eisa
extcon
firewire firewire: net: Make use of get_unaligned_be48(), put_unaligned_be48() 2022-07-28 22:21:54 -07:00
firmware Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
fpga
fsi
gnss
gpio gpio: updates for v6.0-rc1 2022-08-04 18:34:05 -07:00
gpu drm/amd/amdgpu: fix build failure due to implicit declaration 2022-08-04 12:29:10 -07:00
greybus
hid platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
hsi
hte
hv
hwmon hwmon updates for v5.20 2022-08-02 11:07:04 -07:00
hwspinlock
hwtracing
i2c platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
i3c
idle Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
iio
infiniband v5.20 pull request 2022-08-04 19:54:32 -07:00
input SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
interconnect
iommu Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
ipack
irqchip SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
isdn
leds
macintosh
mailbox
mcb
md for-5.20/block-2022-08-04 2022-08-04 20:00:14 -07:00
media SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
memory SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
memstick MMC core: 2022-08-04 19:41:09 -07:00
message
mfd gpio: updates for v6.0-rc1 2022-08-04 18:34:05 -07:00
misc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
mmc MMC core: 2022-08-04 19:41:09 -07:00
most
mtd for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
mux
net v5.20 pull request 2022-08-04 19:54:32 -07:00
nfc
ntb
nubus
nvdimm for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
nvme nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG GAMMIX S70 2022-08-11 14:10:16 +02:00
nvmem SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
of Devicetree updates for v6.0: 2022-08-04 18:08:34 -07:00
opp
parisc
parport
pci pci-v5.20-changes 2022-08-04 19:30:35 -07:00
pcmcia
peci
perf
phy pci-v5.20-changes 2022-08-04 19:30:35 -07:00
pinctrl platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
platform platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
pnp
power platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
powercap Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
pps
ps3
ptp SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
pwm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rapidio
ras
regulator chrome platform changes for 5.20 2022-08-04 18:13:19 -07:00
remoteproc
reset SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rpmsg
rtc
s390 for-5.20/block-2022-08-04 2022-08-04 20:00:14 -07:00
sbus
scsi SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
sh
siox
slimbus
soc SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
soundwire Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
spi Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
spmi
ssb
staging Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
target SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
tc
tee
thermal SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
thunderbolt USB / Thunderbolt changes for 6.0-rc1 2022-08-04 11:41:28 -07:00
tty ARM: SoC drivers for 6.0 2022-08-02 08:10:10 -07:00
ufs SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
uio
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
vdpa
vfio ARM: 2022-08-04 14:59:54 -07:00
vhost
video Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
virt Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
virtio xen: branch for v6.0-rc1 2022-08-04 15:10:55 -07:00
vlynq
w1
watchdog platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
xen xen: branch for v6.0-rc1 2022-08-04 15:10:55 -07:00
zorro
Kconfig
Makefile Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00