linux-kernelorg-stable/drivers/scsi
Alexander Wetzel d4e655c49f scsi: sg: Avoid race in error handling & drop bogus warn
Commit 27f58c04a8 ("scsi: sg: Avoid sg device teardown race") introduced
an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy()
was used after scsi_device_put().

sg_device_destroy() is accessing the parent scsi_device request_queue which
will already be set to NULL when the preceding call to scsi_device_put()
removed the last reference to the parent scsi_device.

Drop the incorrect WARN_ON_ONCE() - allowing more than one concurrent
access to the sg device - and make sure sg_device_destroy() is not used
after scsi_device_put() in the error handling.

Link: https://lore.kernel.org/all/5375B275-D137-4D5F-BE25-6AF8ACAE41EF@linux.ibm.com
Fixes: 27f58c04a8 ("scsi: sg: Avoid sg device teardown race")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
Link: https://lore.kernel.org/r/20240401191038.18359-1-Alexander@wetzel-home.de
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-04-04 18:22:12 -04:00
..
aacraid scsi: aacraid: aachba: Replace snprintf() with the safer scnprintf() variant 2024-01-29 20:34:52 -05:00
aic7xxx
aic94xx
arcmsr
arm
be2iscsi
bfa scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bnx2fc scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload 2024-03-25 20:47:05 -04:00
bnx2i
csiostor scsi: csiostor: Avoid function pointer casts 2024-02-15 15:14:01 -05:00
cxgbi
cxlflash scsi: cxlflash: Make cxlflash_class constant 2024-03-10 18:15:48 -04:00
device_handler scsi: device_handler: rdac: Have midlayer retry send_mode_select() errors 2024-01-29 21:20:53 -05:00
elx
esas2r
fcoe SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
fnic SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
hisi_sas scsi: hisi_sas: Remove hisi_hba->timer for v3 hw 2024-01-24 21:11:54 -05:00
ibmvscsi scsi: ibmvscsi: Convert snprintf() to sysfs_emit() 2024-01-29 20:40:49 -05:00
ibmvscsi_tgt scsi: ibmvscsi_tgt: Convert snprintf() to sysfs_emit() 2024-01-29 20:40:49 -05:00
isci SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
libfc scsi: libfc: replace deprecated strncpy() with memcpy() 2024-02-26 21:21:23 -05:00
libsas scsi: libsas: Align SMP request allocation to ARCH_DMA_MINALIGN 2024-04-01 21:34:23 -04:00
lpfc Merge branch '6.9/scsi-queue' into 6.9/scsi-fixes 2024-03-25 14:03:35 -04:00
megaraid
mpi3mr scsi: mpi3mr: Avoid memcpy field-spanning write WARNING 2024-03-25 15:52:09 -04:00
mpt3sas SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
mvsas
pcmcia
pm8001 scsi: pm8001: Convert snprintf() to sysfs_emit() 2024-01-29 20:40:49 -05:00
qedf
qedi
qla2xxx scsi: qla2xxx: Update version to 10.02.09.200-k 2024-03-10 18:44:44 -04:00
qla4xxx
smartpqi scsi: smartpqi: Fix disable_managed_interrupts 2024-02-15 14:49:10 -05:00
snic
sym53c8xx_2
.gitignore
3w-9xxx.c scsi: 3w-9xxx: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2024-01-29 20:34:52 -05:00
3w-9xxx.h
3w-sas.c scsi: 3w-sas: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2024-01-29 20:34:52 -05:00
3w-sas.h
3w-xxxx.c scsi: 3w-xxxx: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2024-01-29 20:34:52 -05:00
3w-xxxx.h
53c700.c scsi: 53c700: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2024-01-29 20:34:52 -05:00
53c700.h
53c700.scr
53c700_d.h_shipped
BusLogic.c
BusLogic.h
FlashPoint.c
Kconfig SCSI misc on 20240322 2024-03-22 13:31:07 -07:00
Makefile scsi: scsi_proto: Add structures and constants related to I/O groups and streams 2024-02-26 21:37:26 -05:00
NCR5380.c
NCR5380.h
a100u2w.c
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c
aha152x.c
aha152x.h
aha1542.c
aha1542.h
aha1740.c
aha1740.h
am53c974.c
atari_scsi.c
atp870u.c
atp870u.h
bvme6000_scsi.c
ch.c scsi: ch: Make ch_sysfs_class constant 2024-03-10 18:15:48 -04:00
constants.c
dc395x.c
dc395x.h
dmx3191d.c
esp_scsi.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
esp_scsi.h
fdomain.c
fdomain.h
fdomain_isa.c
fdomain_pci.c
g_NCR5380.c
gvp11.c
gvp11.h
hosts.c scsi: core: Fix unremoved procfs host directory regression 2024-03-25 16:59:49 -04:00
hpsa.c
hpsa.h
hpsa_cmd.h
hptiop.c
hptiop.h
imm.c
imm.h
initio.c scsi: initio: Remove redundant variable 'rb' 2024-01-17 14:49:05 -05:00
initio.h
ipr.c
ipr.h
ips.c
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c
iscsi_tcp.h
jazz_esp.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
lasi700.c
libiscsi.c
libiscsi_tcp.c
mac53c94.c powerpc/macio: Make remove callback of macio driver void returned 2024-03-07 23:06:19 +11:00
mac53c94.h
mac_esp.c
mac_scsi.c
megaraid.c scsi: megaraid: Remove redundant assignment to variable 'retval' 2024-01-23 21:38:18 -05:00
megaraid.h
mesh.c powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c
mvumi.h
myrb.c scsi: mylex: Fix sysfs buffer lengths 2024-04-01 21:08:48 -04:00
myrb.h
myrs.c scsi: mylex: Fix sysfs buffer lengths 2024-04-01 21:08:48 -04:00
myrs.h
ncr53c8xx.c
ncr53c8xx.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
pmcraid.c scsi: pmcraid: Make pmcraid_class constant 2024-03-10 18:15:48 -04:00
pmcraid.h
ppa.c
ppa.h
ps3rom.c
qla1280.c scsi: qla1280: Remove redundant assignment to variable 'mr' 2024-02-15 15:09:09 -05:00
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c SCSI misc on 20240322 2024-03-22 13:31:07 -07:00
scsi_bsg.c
scsi_common.c
scsi_debug.c SCSI misc on 20240322 2024-03-22 13:31:07 -07:00
scsi_debugfs.c
scsi_debugfs.h
scsi_devinfo.c scsi: core: Safe warning about bad dev info string 2024-01-23 21:14:40 -05:00
scsi_dh.c
scsi_error.c scsi: core: Move scsi_host_busy() out of host lock if it is for per-command 2024-02-05 16:15:20 -05:00
scsi_ioctl.c
scsi_lib.c SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
scsi_lib_dma.c
scsi_lib_test.c scsi: core: Add kunit tests for scsi_check_passthrough() 2024-01-29 21:20:55 -05:00
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
scsi_proc.c
scsi_proto_test.c scsi: scsi_proto: Add structures and constants related to I/O groups and streams 2024-02-26 21:37:26 -05:00
scsi_sas_internal.h
scsi_scan.c scsi: sd: Fix TCG OPAL unlock on system resume 2024-03-25 15:46:12 -04:00
scsi_sysctl.c
scsi_sysfs.c SCSI misc on 20240322 2024-03-22 13:31:07 -07:00
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c
scsi_transport_iscsi.c scsi: iscsi: Make iscsi_flashnode_bus const 2024-02-05 20:57:18 -05:00
scsi_transport_sas.c
scsi_transport_spi.c scsi: spi: Have midlayer retry spi_execute() UAs 2024-01-29 21:20:53 -05:00
scsi_transport_srp.c
scsicam.c
sd.c scsi: sd: Unregister device if device_add_disk() failed in sd_probe() 2024-04-01 21:26:16 -04:00
sd.h scsi: sd: Translate data lifetime information 2024-02-26 21:37:26 -05:00
sd_dif.c
sd_trace.h
sd_zbc.c
sense_codes.h
ses.c scsi: ses: Have midlayer retry scsi_execute_cmd() errors 2024-01-29 21:20:54 -05:00
sg.c scsi: sg: Avoid race in error handling & drop bogus warn 2024-04-04 18:22:12 -04:00
sgiwd93.c
sim710.c
sni_53c710.c
sr.c scsi: sr: Have midlayer retry get_sectorsize() errors 2024-01-29 21:20:54 -05:00
sr.h
sr_ioctl.c
sr_vendor.c
st.c scsi: st: Make st_sysfs_class constant 2024-03-10 18:15:49 -04:00
st.h
st_options.h
stex.c
storvsc_drv.c scsi: storvsc: Fix ring buffer size calculation 2024-01-23 21:27:28 -05:00
sun3_scsi.c
sun3_scsi_vme.c
sun3x_esp.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
sun_esp.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
virtio_scsi.c Merge branch '6.8/scsi-staging' into 6.8/scsi-fixes 2024-01-22 15:49:29 -05:00
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd719x.c
wd719x.h
xen-scsifront.c
zalon.c
zorro7xx.c
zorro_esp.c