linux-stable/drivers/s390
Peter Oberparleiter 2df56f4ea7 s390/cio: fix race condition during online processing
[ Upstream commit 2d8527f2f9 ]

A race condition exists in ccw_device_set_online() that can cause the
online process to fail, leaving the affected device in an inconsistent
state. As a result, subsequent attempts to set that device online fail
with return code ENODEV.

The problem occurs when a path verification request arrives after
a wait for final device state completed, but before the result state
is evaluated.

Fix this by ensuring that the CCW-device lock is held between
determining final state and checking result state.

Note that since:

commit 2297791c92 ("s390/cio: dont unregister subchannel from child-drivers")

path verification requests are much more likely to occur during boot,
resulting in an increased chance of this race condition occurring.

Fixes: 2297791c92 ("s390/cio: dont unregister subchannel from child-drivers")
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-27 17:11:34 +02:00
..
block s390/dasd: fix double module refcount decrement 2024-03-26 18:19:17 -04:00
char more s390 updates for 6.6 merge window 2023-09-07 10:52:13 -07:00
cio s390/cio: fix race condition during online processing 2024-04-27 17:11:34 +02:00
crypto s390/zcrypt: fix reference counting on zcrypt card objects 2024-04-03 15:28:32 +02:00
net s390/ism: Properly fix receive message buffer allocation 2024-04-27 17:11:33 +02:00
scsi scsi: zfcp: Fix a double put in zfcp_port_enqueue() 2023-09-27 11:31:20 -04:00
virtio s390/airq: remove lsi_mask from airq_struct 2023-08-30 11:03:28 +02:00
Makefile