linux-stable/drivers/scsi
Zheng Wang 89f6023fc3 scsi: qedi: Fix use after free bug in qedi_remove()
[ Upstream commit c5749639f2 ]

In qedi_probe() we call __qedi_probe() which initializes
&qedi->recovery_work with qedi_recovery_handler() and
&qedi->board_disable_work with qedi_board_disable_work().

When qedi_schedule_recovery_handler() is called, schedule_delayed_work()
will finally start the work.

In qedi_remove(), which is called to remove the driver, the following
sequence may be observed:

Fix this by finishing the work before cleanup in qedi_remove().

CPU0                  CPU1

                     |qedi_recovery_handler
qedi_remove          |
  __qedi_remove      |
iscsi_host_free      |
scsi_host_put        |
//free shost         |
                     |iscsi_host_for_each_session
                     |//use qedi->shost

Cancel recovery_work and board_disable_work in __qedi_remove().

Fixes: 4b1068f5d7 ("scsi: qedi: Add MFW error recovery process")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Link: https://lore.kernel.org/r/20230413033422.28003-1-zyytlz.wz@163.com
Acked-by: Manish Rangankar <mrangankar@marvell.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 13:58:42 +02:00
..
aacraid scsi: aacraid: Allocate cmd_priv with scsicmd 2023-03-10 09:29:51 +01:00
aic7xxx
aic94xx scsi: aic94xx: Add missing check for dma_map_single() 2023-03-10 09:28:38 +01:00
arcmsr
arm
be2iscsi
bfa scsi: bfa: Replace one-element array with flexible-array member 2022-11-17 18:15:45 +00:00
bnx2fc
bnx2i
csiostor scsi: csiostor: Remove unused variable 'n' 2022-11-08 03:40:54 +00:00
cxgbi treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
cxlflash driver core: fix up missed scsi/cxlflash class.devnode() conversion. 2022-11-30 13:00:29 +01:00
device_handler scsi: scsi_dh_alua: Fix memleak for 'qdata' in alua_activate() 2023-03-30 12:50:53 +02:00
elx scsi: efct: Fix possible memleak in efct_device_init() 2022-11-25 23:50:35 +00:00
esas2r scsi: esas2r: Introduce scsi_template_proc_dir() 2022-10-18 03:17:09 +00:00
fcoe SCSI misc on 20221213 2022-12-14 08:58:51 -08:00
fnic
hisi_sas scsi: hisi_sas: Handle NCQ error when IPTT is valid 2023-05-11 23:11:11 +09:00
ibmvscsi scsi: ibmvfc: Avoid path failures during live migration 2022-11-07 18:57:39 +00:00
ibmvscsi_tgt
isci
libfc scsi: libfc: Include the correct header 2022-12-01 03:03:36 +00:00
libsas scsi: libsas: Grab the ATA port lock in sas_ata_device_link_abort() 2023-01-07 06:25:08 -05:00
lpfc scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup() 2023-05-11 23:11:13 +09:00
megaraid scsi: megaraid_sas: Fix fw_crash_buffer_show() 2023-04-26 14:29:59 +02:00
mpi3mr scsi: mpi3mr: Handle soft reset in progress fault code (0xF002) 2023-05-11 23:10:48 +09:00
mpt3sas scsi: mpt3sas: Don't print sense pool info twice 2023-04-06 12:12:33 +02:00
mvsas scsi: mvsas: Use sas_task_find_rq() for tagging 2022-10-22 03:02:52 +00:00
pcmcia scsi: pcmcia: nsp_cs: Remove unused variable i 2022-10-27 02:15:46 +00:00
pm8001 SCSI misc on 20221213 2022-12-14 08:58:51 -08:00
qedf scsi: qedf: Remove set but unused variable 'page' 2022-10-22 03:09:45 +00:00
qedi scsi: qedi: Fix use after free bug in qedi_remove() 2023-05-17 13:58:42 +02:00
qla2xxx scsi: qla2xxx: Fix memory leak in qla2x00_probe_one() 2023-04-13 17:02:53 +02:00
qla4xxx scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
smartpqi scsi: smartpqi: Change version to 2.1.20-035 2022-11-17 18:10:59 +00:00
snic scsi: snic: Fix memory leak with using debugfs_lookup() 2023-03-10 09:29:20 +01:00
sym53c8xx_2
.gitignore
3w-9xxx.c
3w-9xxx.h
3w-sas.c
3w-sas.h
3w-xxxx.c
3w-xxxx.h
53c700.c
53c700.h
53c700.scr
53c700_d.h_shipped
BusLogic.c scsi: BusLogic: Remove variable 'adapter_count' 2022-11-08 03:01:12 +00:00
BusLogic.h
FlashPoint.c
Kconfig
Makefile
NCR5380.c scsi: NCR5380: Fix repeated words in comment 2022-11-08 02:57:01 +00:00
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
constants.c
dc395x.c
dc395x.h
dmx3191d.c
esp_scsi.c
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 a procfs host directory removal regression 2023-03-22 13:37:45 +01:00
hpsa.c scsi: hpsa: Fix allocation size for scsi_host_alloc() 2023-01-18 18:59:46 -05:00
hpsa.h
hpsa_cmd.h
hptiop.c
hptiop.h
imm.c
imm.h
initio.c
initio.h
ipr.c scsi: ipr: Work around fortify-string warning 2023-03-11 13:50:35 +01:00
ipr.h
ips.c
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param() 2023-04-13 17:02:53 +02:00
iscsi_tcp.h
jazz_esp.c
lasi700.c
libiscsi.c scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress 2023-01-18 19:14:56 -05:00
libiscsi_tcp.c
mac53c94.c
mac53c94.h
mac_esp.c
mac_scsi.c
megaraid.c scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS 2023-05-11 23:11:10 +09:00
megaraid.h
mesh.c
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
mvumi.h
myrb.c
myrb.h
myrs.c
myrs.h
ncr53c8xx.c
ncr53c8xx.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
pmcraid.c
pmcraid.h
ppa.c
ppa.h
ps3rom.c
qla1280.c
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c scsi: core: Improve scsi_vpd_inquiry() checks 2023-04-26 14:30:00 +02:00
scsi_bsg.c
scsi_common.c
scsi_debug.c Merge branch '6.2/scsi-queue' into 6.2/scsi-fixes 2022-12-30 16:29:34 +00:00
scsi_debugfs.c
scsi_debugfs.h
scsi_devinfo.c scsi: core: Add BLIST_SKIP_VPD_PAGES for SKhynix H28U74301AMR 2023-03-30 12:51:33 +02:00
scsi_dh.c
scsi_error.c Merge branch '6.2/scsi-queue' into 6.2/scsi-fixes 2022-12-30 16:29:34 +00:00
scsi_ioctl.c scsi: core: Rename status_byte to sg_status_byte 2022-12-01 03:22:23 +00:00
scsi_lib.c SCSI misc on 20221213 2022-12-14 08:58:51 -08:00
scsi_lib_dma.c
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h scsi: core: Introduce a new list for SCSI proc directory entries 2022-10-18 03:17:09 +00:00
scsi_proc.c scsi: core: Introduce a new list for SCSI proc directory entries 2022-10-18 03:17:09 +00:00
scsi_sas_internal.h
scsi_scan.c scsi: core: Add BLIST_NO_VPD_SIZE for some VDASD 2023-03-22 13:37:44 +01:00
scsi_sysctl.c
scsi_sysfs.c scsi: core: Fix the scsi_device_put() might_sleep annotation 2023-01-26 22:01:31 -05:00
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
scsi_transport_iscsi.c Merge branch '6.2/scsi-queue' into 6.2/scsi-fixes 2022-12-30 16:29:34 +00:00
scsi_transport_sas.c scsi: scsi_transport_sas: Fix error handling in sas_phy_add() 2022-11-08 01:52:52 +00:00
scsi_transport_spi.c
scsi_transport_srp.c scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
scsicam.c
sd.c scsi: sd: Fix wrong zone_write_granularity value during revalidate 2023-03-17 08:57:57 +01:00
sd.h
sd_dif.c
sd_trace.h scsi: sd: sd_zbc: Trace zone append emulation 2022-12-01 03:13:55 +00:00
sd_zbc.c scsi: sd: Fix wrong zone_write_granularity value during revalidate 2023-03-17 08:57:57 +01:00
sense_codes.h
ses.c scsi: ses: Handle enclosure with just a primary component gracefully 2023-04-20 12:36:58 +02:00
sg.c SCSI misc on 20221222 2022-12-22 11:22:31 -08:00
sgiwd93.c
sim710.c
sni_53c710.c
sr.c
sr.h
sr_ioctl.c
sr_vendor.c
st.c
st.h
st_options.h
stex.c
storvsc_drv.c scsi: storvsc: Handle BlockSize change in Hyper-V VHD/VHDX file 2023-03-30 12:51:30 +02:00
sun3_scsi.c
sun3_scsi_vme.c
sun3x_esp.c
sun_esp.c
virtio_scsi.c scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd719x.c
wd719x.h
xen-scsifront.c xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00
zalon.c
zorro7xx.c
zorro_esp.c