]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
scsi: ibmvscsi: Protect ibmvscsi_head from concurrent modificaiton
authorTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Wed, 20 Mar 2019 18:41:50 +0000 (13:41 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitfc32b68611aa79f169ab02e897e2eaec42934259
tree9ad244a1ea91458cc319be72ba81e333f81f55fb
parent6d36e879afa862a8b8eb6f67dcc925569ae1a4ae
scsi: ibmvscsi: Protect ibmvscsi_head from concurrent modificaiton

BugLink: https://bugs.launchpad.net/bugs/1838116
commit 7205981e045e752ccf96cf6ddd703a98c59d4339 upstream.

For each ibmvscsi host created during a probe or destroyed during a remove
we either add or remove that host to/from the global ibmvscsi_head
list. This runs the risk of concurrent modification.

This patch adds a simple spinlock around the list modification calls to
prevent concurrent updates as is done similarly in the ibmvfc driver and
ipr driver.

Fixes: 32d6e4b6e4ea ("scsi: ibmvscsi: add vscsi hosts to global list_head")
Cc: <stable@vger.kernel.org> # v4.10+
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/ibmvscsi/ibmvscsi.c