[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aTkXqslvwMOz2TUG@infradead.org>
Date: Tue, 9 Dec 2025 22:48:10 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Po-Wen Kao <powenkao@...gle.com>
Cc: Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
Bart Van Assche <bvanassche@....org>,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER" <linux-scsi@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] scsi: ufs: core: Fix error handler encryption support
On Mon, Dec 08, 2025 at 02:52:21AM +0000, Po-Wen Kao wrote:
> From: Brian Kao <powenkao@...gle.com>
>
> The UFS driver utilizes block layer crypto fields, such as
> rq->crypt_keyslot and rq->crypt_ctx, to configure hardware for inline
> encryption. However, the SCSI error handler (EH) reuses the
> Protocol Data Unit (PDU) from the original failing request when issuing
> EH commands (e.g., TEST UNIT READY, START STOP UNIT).
>
> This can lead to issues if the original request of reused PDU contains
> stale cryptographic configurations, which are not applicable for
> the simple EH commands. These commands should not involve data
> encryption.
>
> This patch fixes this by checking if the command was submitted by the
> SCSI error handler. If so, it bypasses the cryptographic setup for
> the request, ensuring UTRDs are not inadvertently
> configured with potentially incorrect encryption parameters.
As mentioned last round, why are you even calling into the crypto
code here? Calling that for a request without a crypt context,
which includes all of them that do not transfer any data makes no
sense to start with.
Powered by blists - more mailing lists