linux/drivers/message/fusion
Zheng Wang 9c6da3b7f1 scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition
[ Upstream commit f486893288 ]

mptlan_probe() calls mpt_register_lan_device() which initializes the
&priv->post_buckets_task workqueue. A call to
mpt_lan_wake_post_buckets_task() will subsequently start the work.

During driver unload in mptlan_remove() the following race may occur:

CPU0                  CPU1

                    |mpt_lan_post_receive_buckets_work()
mptlan_remove()     |
  free_netdev()     |
    kfree(dev);     |
                    |
                    | dev->mtu
                    |   //use

Fix this by finishing the work prior to cleaning up in mptlan_remove().

[mkp: we really should remove mptlan instead of attempting to fix it]

Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Link: https://lore.kernel.org/r/20230318081635.796479-1-zyytlz.wz@163.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-24 17:32:37 +01:00
..
lsi
Kconfig
Makefile
mptbase.c
mptbase.h
mptctl.c scsi: message: fusion: Remove redundant variable iocnum 2022-08-31 23:39:57 -04:00
mptctl.h
mptdebug.h
mptfc.c
mptlan.c scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-24 17:32:37 +01:00
mptlan.h
mptsas.c
mptsas.h
mptscsih.c
mptscsih.h
mptspi.c scsi: message: fusion: Drop redundant "the" 2022-06-21 21:34:52 -04:00