Files
linux/drivers/scsi
Uday Shankar 022577b941 scsi: core: Restrict legal sdev_state transitions via sysfs
[ Upstream commit 2331ce6126 ]

Userspace can currently write to sysfs to transition sdev_state to RUNNING
or OFFLINE from any source state. This causes issues because proper
transitioning out of some states involves steps besides just changing
sdev_state, so allowing userspace to change sdev_state regardless of the
source state can result in inconsistencies; e.g. with ISCSI we can end up
with sdev_state == SDEV_RUNNING while the device queue is quiesced. Any
task attempting I/O on the device will then hang, and in more recent
kernels, iscsid will hang as well.

More detail about this bug is provided in my first attempt:

https://groups.google.com/g/open-iscsi/c/PNKca4HgPDs/m/CXaDkntOAQAJ

Link: https://lore.kernel.org/r/20220924000241.2967323-1-ushankar@purestorage.com
Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Suggested-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 18:17:25 +01:00
..
2022-05-23 23:24:09 -04:00
2022-05-23 23:24:10 -04:00
2022-02-22 21:11:02 -05:00
2022-07-26 22:13:29 -04:00
2022-09-01 01:02:10 -04:00
2022-02-22 21:11:02 -05:00
2022-06-27 22:56:21 -04:00
2022-06-27 22:56:21 -04:00
2022-01-25 00:09:41 -05:00
2022-02-22 21:11:02 -05:00
2022-09-01 01:02:10 -04:00
2022-09-01 01:02:10 -04:00
2022-01-22 08:33:37 +02:00
2022-09-01 01:02:10 -04:00
2022-05-08 14:28:18 -04:00
2021-12-22 23:41:13 -05:00
2022-06-28 06:30:26 -06:00