Neeraj Soni
fd78e2b582
mmc: sdhci-msm: Add support for wrapped keys
Add the wrapped key support for sdhci-msm by implementing the needed
methods in struct blk_crypto_ll_ops and setting the appropriate flag in
blk_crypto_profile::key_types_supported.
Tested on SC7280 eMMC variant.
How to test:
Use the "v1.3.0" tag from https://github.com/google/fscryptctl and build
fscryptctl that supports generating wrapped keys.
Enable the following config options:
CONFIG_BLK_INLINE_ENCRYPTION=y
CONFIG_QCOM_INLINE_CRYPTO_ENGINE=y
CONFIG_FS_ENCRYPTION_INLINE_CRYPT=y
CONFIG_MMC_CRYPTO=y
Enable "qcom_ice.use_wrapped_keys" via kernel command line.
$ mkfs.ext4 -F -O encrypt,stable_inodes /dev/disk/by-partlabel/vm-data
$ mount /dev/disk/by-partlabel/vm-data -o inlinecrypt /mnt
$ fscryptctl generate_hw_wrapped_key /dev/disk/by-partlabel/vm-data > /mnt/key.longterm
$ fscryptctl prepare_hw_wrapped_key /dev/disk/by-partlabel/vm-data < /mnt/key.longterm > /tmp/key.ephemeral
$ KEYID=$(fscryptctl add_key --hw-wrapped-key < /tmp/key.ephemeral /mnt)
$ rm -rf /mnt/dir
$ mkdir /mnt/dir
$ fscryptctl set_policy --iv-ino-lblk-32 "$KEYID" /mnt/dir
$ dmesg > /mnt/dir/test.txt
$ sync
Reboot the board
$ mount /dev/disk/by-partlabel/vm-data -o inlinecrypt /mnt
$ ls /mnt/dir # File should be encrypted
$ fscryptctl prepare_hw_wrapped_key /dev/disk/by-partlabel/vm-data < /mnt/key.longterm > /tmp/key.ephemeral
$ KEYID=$(fscryptctl add_key --hw-wrapped-key < /tmp/key.ephemeral /mnt)
$ fscryptctl set_policy --iv-ino-lblk-32 "$KEYID" /mnt/dir
$ cat /mnt/dir/test.txt # File should now be decrypted
Tested-by: Wenjia Zhang <wenjia.zhang@oss.qualcomm.com>
Signed-off-by: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-23 15:46:50 +01:00
..
2025-08-22 12:14:03 +02:00
2026-02-23 12:06:53 +01:00
2025-08-22 12:14:03 +02:00
2025-07-03 14:17:35 +02:00
2026-02-23 12:06:53 +01:00
2025-05-14 16:59:18 +02:00
2026-02-23 12:06:53 +01:00
2025-08-22 12:14:03 +02:00
2024-07-08 11:41:30 +02:00
2024-09-03 14:22:10 +02:00
2025-02-10 09:54:19 -07:00
2021-08-24 10:15:32 +02:00
2025-11-26 11:47:05 +01:00
2025-10-21 13:37:38 +02:00
2026-02-24 10:32:47 +01:00
2026-02-23 12:06:53 +01:00
2019-05-30 11:26:32 -07:00
2026-02-23 12:06:53 +01:00
2026-03-16 15:43:42 +01:00
2026-02-24 10:32:47 +01:00
2026-02-24 10:32:47 +01:00
2026-02-24 10:32:47 +01:00
2026-02-24 10:32:47 +01:00
2026-03-16 15:43:42 +01:00
2026-02-23 12:06:53 +01:00
2026-03-16 15:43:42 +01:00
2026-03-16 15:43:42 +01:00
2026-02-23 12:06:53 +01:00
2026-02-24 10:32:47 +01:00
2025-06-24 12:43:22 +02:00
2026-03-09 14:19:23 +01:00
2026-02-23 12:06:55 +01:00
2024-10-14 12:40:10 +02:00
2025-08-19 14:34:15 +02:00
2025-06-24 12:43:22 +02:00
2020-05-28 11:22:14 +02:00
2025-11-18 16:21:36 +01:00
2023-09-27 12:13:18 +02:00
2023-09-27 12:13:18 +02:00
2026-02-21 17:09:51 -08:00
2026-02-23 12:05:20 +01:00
2024-08-29 07:22:49 +03:00
2025-08-22 12:14:03 +02:00
2024-10-14 12:40:10 +02:00
2025-06-24 12:43:23 +02:00
2026-02-23 12:06:52 +01:00
2025-09-12 14:04:22 +02:00
2019-06-19 17:09:55 +02:00
2025-06-24 12:43:23 +02:00
2025-08-22 12:14:03 +02:00
2026-02-21 17:09:51 -08:00
2025-10-21 13:37:38 +02:00
2025-11-11 18:15:01 +01:00
2025-06-24 12:43:23 +02:00
2025-11-11 17:34:28 +01:00
2026-03-09 13:44:45 +01:00
2025-11-18 16:28:54 +01:00
2026-03-09 14:20:57 +01:00
2025-11-18 16:28:54 +01:00
2026-03-04 16:33:36 +01:00
2025-08-22 12:14:04 +02:00
2025-08-22 12:14:04 +02:00
2025-06-24 12:43:26 +02:00
2022-12-07 13:22:36 +01:00
2025-08-22 12:14:04 +02:00
2025-06-24 12:43:24 +02:00
2026-02-23 12:05:20 +01:00
2025-08-22 12:14:04 +02:00
2022-11-07 13:28:47 +01:00
2025-06-24 12:43:24 +02:00
2026-03-16 16:14:05 +01:00
2025-06-24 12:43:24 +02:00
2020-10-28 11:07:01 +01:00
2025-06-24 12:43:24 +02:00
2025-06-24 12:43:24 +02:00
2026-03-23 15:46:50 +01:00
2025-06-24 12:43:25 +02:00
2026-02-24 10:32:39 +01:00
2022-07-11 17:13:32 -06:00
2026-02-23 12:06:53 +01:00
2025-08-22 12:14:04 +02:00
2026-03-09 14:03:24 +01:00
2026-01-22 13:26:08 +01:00
2025-08-22 12:14:04 +02:00
2024-10-14 12:29:01 +02:00
2026-02-23 12:06:55 +01:00
2025-06-24 12:43:25 +02:00
2025-06-24 12:43:25 +02:00
2025-08-22 12:14:04 +02:00
2025-08-18 11:19:45 +02:00
2018-07-16 11:21:45 +02:00
2026-03-04 17:48:59 +01:00
2024-06-20 10:57:44 +02:00
2024-12-02 15:06:03 +01:00
2026-02-24 10:32:47 +01:00
2026-03-16 16:14:29 +01:00
2025-06-24 12:43:26 +02:00
2025-06-24 12:43:25 +02:00
2025-08-22 12:14:03 +02:00
2025-08-22 12:14:04 +02:00
2025-08-22 12:14:04 +02:00
2025-08-22 12:14:04 +02:00
2025-08-22 12:14:04 +02:00
2025-08-22 12:14:04 +02:00
2026-02-24 10:32:14 +01:00
2024-10-24 14:37:42 +02:00
2024-02-28 13:41:35 +01:00
2025-08-22 12:14:03 +02:00
2024-01-05 11:03:56 +01:00
2026-03-16 16:13:02 +01:00
2025-08-22 12:13:52 +02:00
2025-06-24 12:43:23 +02:00
2025-09-12 14:11:33 +02:00
2025-05-14 16:59:17 +02:00
2025-08-22 12:14:03 +02:00
2026-03-09 14:24:47 +01:00
2025-08-19 14:34:14 +02:00
2025-11-18 16:28:54 +01:00
2025-08-22 12:14:04 +02:00
2019-05-30 11:26:32 -07:00
2025-06-24 12:43:24 +02:00
2025-09-21 14:22:08 -07:00
2026-02-21 17:09:51 -08:00
2025-08-22 12:14:05 +02:00
2025-06-24 12:43:23 +02:00
2025-06-24 12:43:24 +02:00
2024-07-08 11:41:30 +02:00
2025-08-22 12:14:04 +02:00