linux/drivers/s390
Stefan Haberland 53563ca57c s390/dasd: fix list corruption of lcu list
commit 53a7f65583 upstream.

In dasd_alias_disconnect_device_from_lcu the device is removed from any
list on the LCU. Afterwards the LCU is removed from the lcu list if it
does not contain devices any longer.

The lcu->lock protects the lcu from parallel updates. But to cancel all
workers and wait for completion the lcu->lock has to be unlocked.

If two devices are removed in parallel and both are removed from the LCU
the first device that takes the lcu->lock again will delete the LCU because
it is already empty but the second device also tries to free the LCU which
leads to a list corruption of the lcu list.

Fix by removing the device right before the lcu is checked without
unlocking the lcu->lock in between.

Fixes: 8e09f21574 ("[S390] dasd: add hyper PAV support to DASD device driver, part 1")
Cc: stable@vger.kernel.org
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:26:10 +01:00
..
block s390/dasd: fix list corruption of lcu list 2020-12-30 11:26:10 +01:00
char s390/kasan: avoid instrumentation of early C code 2019-11-24 08:20:44 +01:00
cio s390/cio: add cond_resched() in the slow_eval_known_fn() loop 2020-09-03 11:24:24 +02:00
crypto s390/zcrypt: Fix ZCRYPT_PERDEV_REQCNT ioctl 2020-10-01 13:14:54 +02:00
net s390/qeth: fix tear down of async TX buffers 2020-12-02 08:48:11 +01:00
scsi scsi: zfcp: Fix use-after-free in request timeout handlers 2020-08-26 10:30:59 +02:00
virtio virtio/s390: fix race on airq_areas[] 2019-09-16 08:22:23 +02:00
Makefile