scsi: ufs: core: Add UFSHCD_QUIRK_KEYS_IN_PRDT
authorEric Biggers <ebiggers@google.com>
Mon, 8 Jul 2024 23:53:29 +0000 (16:53 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 11 Jul 2024 02:32:30 +0000 (22:32 -0400)
commit4c45dba50a3750a0834353c4187e7896b158bc0c
tree4155b7b267dccc57450440736128b1ba207a2b1e
parent8ecea3da1567e0648b5d37a6faec73fc9c8571ba
scsi: ufs: core: Add UFSHCD_QUIRK_KEYS_IN_PRDT

Since the nonstandard inline encryption support on Exynos SoCs requires
that raw cryptographic keys be copied into the PRDT, it is desirable to
zeroize those keys after each request to keep them from being left in
memory.  Therefore, add a quirk bit that enables the zeroization.

We could instead do the zeroization unconditionally.  However, using a
quirk bit avoids adding the zeroization overhead to standard devices.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20240708235330.103590-6-ebiggers@kernel.org
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd-crypto.h
drivers/ufs/core/ufshcd.c
include/ufs/ufshcd.h