OpenCloudOS-Kernel/drivers
Mike Christie 4c363c81f6 vhost-scsi: Fix crash during LUN unmapping
We normally clear the endpoint then unmap LUNs so the devices are fully
shutdown when the LUN is unmapped, but it's legal to unmap before
clearing. If the user does that while TMFs are running then we can end
up crashing.

vhost_scsi_port_unlink assumes that the LUN's tmf struct will always be on
the tmf_queue list. However, if a TMF is running then it will have been
removed while it's executing. If we do a LUN unmap at this time, then
we assume the entry is on the list and just start accessing it and free
it.

This fixes the bug by just allocating the vhost_scsi_tmf struct when it's
needed like is done with the se_tmr struct that's needed when we submit
the TMF. In this path perf is not an issue and we can use GFP_KERNEL
since it won't swing directly back on us, so we don't need to preallocate
the struct.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Message-Id: <20230321020624.13323-3-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-04-04 11:01:58 -04:00
..
accel accel/ivpu: Fix IPC buffer header status field value 2023-03-24 10:52:20 +01:00
accessibility
acpi ACPI: bus: Rework system-level device notification handling 2023-03-27 19:56:03 +02:00
amba
android Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
ata ata: pata_parport: fix memory leaks 2023-03-16 16:54:38 +09:00
atm atm: idt77252: fix kmemleak when rmmod idt77252 2023-03-21 20:19:28 -07:00
auxdisplay
base cacheinfo: Fix LLC is not exported through sysfs 2023-03-29 12:04:10 +02:00
bcma
block virtio-blk: fix ZBD probe in kernels without ZBD support 2023-04-04 11:01:57 -04:00
bluetooth Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work 2023-03-23 13:09:38 -07:00
bus bus: imx-weim: fix branch condition evaluates to a garbage value 2023-03-14 11:43:51 +08:00
cdrom
char tpm: disable hwrng for fTPM on some AMD designs 2023-03-12 23:28:10 +02:00
clk clk: k210: remove an implicit 64-bit division 2023-03-06 14:41:20 -08:00
clocksource Updates for timekeeping, timers and clockevent/source drivers: 2023-02-21 09:45:13 -08:00
comedi
connector
counter
cpufreq More power management updates for 6.3-rc1 2023-03-03 10:30:58 -08:00
cpuidle cpuidle: psci: Iterate backwards over list in psci_pd_remove() 2023-03-07 14:04:13 +01:00
crypto This push fixes a regression in the caam driver. 2023-03-05 11:32:30 -08:00
cxl cxl for v6.3 2023-02-25 09:19:23 -08:00
dax cxl for v6.3 2023-02-25 09:19:23 -08:00
dca
devfreq
dio
dma dmaengine updates for v6.3 2023-02-24 17:18:54 -08:00
dma-buf dma-buf: make kobj_type structure constant 2023-02-17 09:16:34 +01:00
edac - Add a driver for the RAS functionality on Xilinx's on chip memory 2023-02-21 08:10:03 -08:00
eisa
extcon extcon: intel-cht-wc: Add support for Lenovo Yoga Tab 3 Pro YT3-X90F 2023-02-04 13:05:42 +00:00
firewire Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
firmware ARM: SoC fixes for 6.3, part 2 2023-03-24 15:38:13 -07:00
fpga Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
fsi
gnss
gpio ACPI: x86: Introduce an acpi_quirk_skip_gpio_event_handlers() helper 2023-03-07 14:15:10 +01:00
gpu Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux into drm-fixes 2023-03-30 20:15:07 +02:00
greybus
hid for-linus-2023030901 2023-03-09 10:17:23 -08:00
hsi Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
hte
hv Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
hwmon hwmon (it87): Fix voltage scaling for chips with 10.9mV ADCs 2023-03-21 19:14:55 -07:00
hwspinlock
hwtracing Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
i2c i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer() 2023-03-16 21:15:43 +01:00
i3c I3C for 6.3 2023-02-28 16:05:01 -08:00
idle Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
iio Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
infiniband v6.3 RDMA pull request 2023-02-24 15:11:03 -08:00
input Input updates for v6.3-rc4 2023-04-01 14:09:51 -07:00
interconnect interconnect: exynos: drop redundant link destroy 2023-03-13 21:13:48 +02:00
iommu iommu/vt-d: Fix an IOMMU perfmon warning when CPU hotplug 2023-03-31 10:06:16 +02:00
ipack Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
irqchip ARM: 2023-02-25 11:30:21 -08:00
isdn
leds - Remove Drivers 2023-02-23 15:09:31 -08:00
macintosh powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
mailbox mailbox: qcom-apcs-ipc: add IPQ5332 APSS clock support 2023-02-23 14:47:13 -06:00
mcb
md block-6.3-2023-03-30 2023-03-31 12:35:03 -07:00
media Revert "venus: firmware: Correct non-pix start and end addresses" 2023-04-02 10:47:03 -07:00
memory memory: tegra30-emc: fix interconnect registration race 2023-03-13 21:13:49 +02:00
memstick MMC core: 2023-02-27 09:47:26 -08:00
message
mfd Including fixes from wireless and netfilter. 2023-02-27 14:05:08 -08:00
misc misc: ad525x_dpot-i2c: Convert to i2c's .probe_new() 2023-03-09 21:58:45 +01:00
mmc mmc: dw_mmc-starfive: Fix initialization of prev_err 2023-03-09 15:33:51 +01:00
most
mtd Driver core fixes for 6.3-rc5 2023-04-02 10:10:16 -07:00
mux
net net: ethernet: mtk_eth_soc: add missing ppe cache flush when deleting a flow 2023-03-30 11:44:59 -07:00
nfc nfc: st-nci: Fix use after free bug in ndlc_remove due to race condition 2023-03-15 00:28:23 -07:00
ntb
nubus
nvdimm virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
nvme nvme-tcp: fix a possible UAF when failing to allocate an io queue 2023-03-30 11:24:33 +09:00
nvmem nvmem: core: return -ENOENT if nvmem cell is not found 2023-03-10 10:55:49 +01:00
of IOMMU Updates for Linux v6.3: 2023-02-24 13:40:13 -08:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-02-16 13:48:53 +01:00
parisc
parport Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
pci pci-v6.3-fixes-1 2023-03-31 13:07:01 -07:00
pcmcia Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
peci
perf RISC-V Patches for the 6.3 Merge Window, Part 2 2023-03-03 09:32:51 -08:00
phy ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
pinctrl pinctrl: amd: Disable and mask interrupts on resume 2023-03-28 15:20:18 +02:00
platform platform-drivers-x86 for v6.3-4 2023-03-31 13:11:06 -07:00
pnp
power power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition 2023-03-12 23:28:04 +01:00
powercap More power management updates for 6.3-rc1 2023-03-03 10:30:58 -08:00
pps
ps3
ptp ptp_qoriq: fix memory leak in probe() 2023-03-24 19:17:22 -07:00
pwm pwm: dwc: Use devm_pwmchip_add() 2023-02-20 12:26:35 +01:00
rapidio
ras
regulator regulator: Handle deferred clk 2023-03-27 01:42:01 +01:00
remoteproc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
reset
rpmsg rpmsg updates for v6.3 2023-02-26 12:10:28 -08:00
rtc RTC for 6.3 2023-03-03 09:15:50 -08:00
s390 s390/vfio-ap: fix memory leak in vfio_ap device driver 2023-03-27 17:23:08 +02:00
sbus mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
scsi SCSI fixes on 20230330 2023-03-30 15:52:45 -07:00
sh sh updates for v6.3 2023-03-01 09:44:22 -08:00
siox
slimbus
soc soc: qcom: rmtfs: handle optional qcom,vmid correctly 2023-03-06 20:13:06 -08:00
soundwire soundwire updates for 6.3 2023-02-24 17:29:52 -08:00
spi spi: Fixes for v6.3 2023-03-02 09:25:38 -08:00
spmi
ssb
staging staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00
target scsi: target: iscsi: Fix an error message in iscsi_check_key() 2023-03-06 16:50:42 -05:00
tc
tee AMDTEE fix race condition in amdtee_open_session() 2023-03-17 15:30:31 +01:00
thermal Merge branch 'thermal-intel-fixes' 2023-03-31 12:02:46 +02:00
thunderbolt thunderbolt: Rename shadowed variables bit to interrupt_bit and auto_clear_bit 2023-03-20 19:00:58 +02:00
tty xen: branch for v6.3-rc4 2023-03-24 09:44:43 -07:00
ufs scsi: ufs: mcq: Use active_reqs to check busy in clock scaling 2023-03-09 21:09:28 -05:00
uio - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
usb usb: dwc2: fix a race, don't power off/on phy for dual-role mode 2023-03-23 19:13:16 +01:00
vdpa vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready 2023-03-13 02:29:12 -04:00
vfio vfio/mlx5: Fix the report of dirty_bytes upon pre-copy 2023-03-13 12:50:59 -06:00
vhost vhost-scsi: Fix crash during LUN unmapping 2023-04-04 11:01:58 -04:00
video fbdev updates for kernel 6.3-rc3: 2023-03-18 16:01:34 -07:00
virt virt/coco/sev-guest: Add throttling awareness 2023-03-13 13:29:27 +01:00
virtio virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
vlynq
w1 w1: ds2482: Convert to i2c's .probe_new() 2023-03-09 21:58:57 +01:00
watchdog linux-watchdog 6.3-rc1 tag 2023-03-02 11:12:01 -08:00
xen xen: branch for v6.3-rc3 2023-03-17 10:45:49 -07:00
zorro
Kconfig
Makefile Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00