mirror-linux/include/scsi
Brian Kao 9a49157dee scsi: core: Fix error handler encryption support
Some low-level drivers (LLD) access block layer crypto fields, such as
rq->crypt_keyslot and rq->crypt_ctx within `struct request`, to
configure hardware for inline encryption.  However, SCSI Error Handling
(EH) commands (e.g., TEST UNIT READY, START STOP UNIT) should not
involve any encryption setup.

To prevent drivers from erroneously applying crypto settings during EH,
this patch saves the original values of rq->crypt_keyslot and
rq->crypt_ctx before an EH command is prepared via scsi_eh_prep_cmnd().
These fields in the 'struct request' are then set to NULL.  The original
values are restored in scsi_eh_restore_cmnd() after the EH command
completes.

This ensures that the block layer crypto context does not leak into EH
command execution.

Signed-off-by: Brian Kao <powenkao@google.com>
Link: https://patch.msgid.link/20251218031726.2642834-1-powenkao@google.com
Cc: stable@vger.kernel.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-01-04 15:16:20 -05:00
..
fc
fc_frame.h
fcoe_sysfs.h scsi: fcoe: Simplify alloc_ordered_workqueue() invocations 2024-08-22 21:28:56 -04:00
iscsi_if.h
iscsi_proto.h
iser.h scsi: iser: Fix @read_stag kernel-doc warning 2024-04-08 22:10:06 -04:00
libfc.h scsi: Rename .slave_alloc() and .slave_destroy() 2024-12-04 15:34:28 -05:00
libfcoe.h scsi: libfcoe: Include <linux/prandom.h> instead of <linux/random.h> 2024-10-03 18:20:03 +02:00
libiscsi.h scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
libiscsi_tcp.h scsi: iscsi_tcp: Switch to using the crc32c library 2025-02-12 22:05:10 -05:00
libsas.h SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
sas.h
sas_ata.h scsi: libsas: Move declarations of internal functions to sas_internal.h 2025-07-25 09:03:57 -04:00
scsi.h scsi: core: Don't use "proxy" headers 2024-04-24 21:27:15 -04:00
scsi_bsg_iscsi.h scsi: bsg: Replace zero-length array with flexible array member 2024-12-04 13:04:42 -05:00
scsi_cmnd.h scsi: core: Fix the return value of scsi_logical_block_count() 2024-08-16 21:02:06 -04:00
scsi_common.h scsi: Add support for block PR read keys/reservation 2023-04-11 21:55:35 -04:00
scsi_dbg.h scsi: core: Do not declare scsi_cmnd pointers const 2025-10-21 21:11:35 -04:00
scsi_device.h Merge branch 6.18/scsi-fixes into 6.19/scsi-staging 2025-11-19 22:59:25 -05:00
scsi_devinfo.h scsi: core: Introduce the BLIST_SKIP_IO_HINTS flag 2024-06-13 21:03:13 -04:00
scsi_dh.h
scsi_driver.h SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
scsi_eh.h scsi: core: Fix error handler encryption support 2026-01-04 15:16:20 -05:00
scsi_host.h scsi: core: Introduce .queue_reserved_command() 2025-11-12 17:02:31 -05:00
scsi_ioctl.h scsi: replace the fmode_t argument to scsi_ioctl with a simple bool 2023-06-12 08:04:04 -06:00
scsi_proto.h scsi: sd: Remove the stream_status member from scsi_stream_status_header 2025-05-12 22:16:10 -04:00
scsi_status.h scsi: core: Remove useless host error codes 2022-09-06 22:05:59 -04:00
scsi_tcq.h
scsi_transport.h scsi: core: Initialize scsi midlayer limits before allocating the queue 2024-04-11 21:37:48 -04:00
scsi_transport_fc.h scsi: scsi_transport_fc: Change to use per-rport devloss_work_q 2025-07-14 20:57:08 -04:00
scsi_transport_iscsi.h Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
scsi_transport_sas.h scsi: mpi3mr: Fix ATA NCQ priority support 2024-06-11 21:40:23 -04:00
scsi_transport_spi.h
scsi_transport_srp.h scsi: scsi_transport_srp: Fix a couple of kernel-doc warnings 2024-04-08 22:10:06 -04:00
scsicam.h scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
sg.h scsi: core: Rename status_byte to sg_status_byte 2022-12-01 03:22:23 +00:00
srp.h
viosrp.h