[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3064625c-9ce6-4d40-9a2b-91f58af364f0@acm.org>
Date: Mon, 1 Dec 2025 15:33:58 -1000
From: Bart Van Assche <bvanassche@....org>
To: Po-Wen Kao <powenkao@...gle.com>
Cc: "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"open list:SCSI SUBSYSTEM" <linux-scsi@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>, Eric Biggers <ebiggers@...nel.org>
Subject: Re: [PATCH 1/1] scsi: core: Fix error handler encryption support
On 12/1/25 5:15 PM, Po-Wen Kao wrote:
(+Eric Biggers)
> 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.
Since I suggested this approach I think it is appropriate to add the
following:
Suggested-by: Bart Van Assche <bvanassche@....org>
Reviewed-by: Bart Van Assche <bvanassche@....org>
Powered by blists - more mailing lists