Files
kernel_xiaomi_sm8250/include/linux
Eric Biggers a8f636f2ba ANDROID: block: require drivers to declare supported crypto key type(s)
We need a way to tell which type of keys the inline crypto hardware
supports (standard, wrapped, or both), so that fallbacks can be used
when needed (either blk-crypto-fallback, or fscrypt fs-layer crypto).

We can't simply assume that

    keyslot_mgmt_ll_ops::derive_raw_secret == NULL

means only standard keys are supported and that

    keyslot_mgmt_ll_ops::derive_raw_secret != NULL

means that only wrapped keys are supported, because device-mapper
devices always implement this method.  Also, hardware might support both
types of keys.

Therefore, add a field keyslot_manager::features which contains a
bitmask of flags which indicate the supported types of keys.  Drivers
will need to fill this in.  This patch makes the UFS standard crypto
code set BLK_CRYPTO_FEATURE_STANDARD_KEYS, but UFS variant drivers may
need to set BLK_CRYPTO_FEATURE_WRAPPED_KEYS instead.

Then, make keyslot_manager_crypto_mode_supported() take the key type
into account.

Bug: 137270441
Bug: 151100202
Test: 'atest vts_kernel_encryption_test' on Pixel 4 with the
      inline crypto patches backported, and also on Cuttlefish.
Change-Id: Ied846c2767c1fd2f438792dcfd3649157e68b005
Signed-off-by: Eric Biggers <ebiggers@google.com>
Git-commit: 8f078b1b3a
Git-repo: https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19
[neersoni@codeaurora.org: key capability parameter added for ufs and emmc]
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2020-07-08 10:19:08 -07:00
..
2019-12-13 08:51:18 +01:00
2019-03-13 15:01:42 +05:30
2019-12-17 20:35:45 +01:00
2019-10-05 13:10:03 +02:00
2019-11-13 16:06:14 +05:30
2019-07-03 13:14:48 +02:00
2020-04-24 15:19:09 -07:00
2019-08-11 15:21:36 +02:00
2019-11-25 10:00:42 +01:00
2020-06-17 06:00:22 +05:30
2020-04-24 15:19:09 -07:00
2019-05-31 06:46:18 -07:00
2020-05-11 10:27:22 -07:00
2019-10-17 13:45:42 -07:00
2020-01-15 14:51:23 +00:00
2019-12-13 10:01:10 +01:00
2019-12-31 16:35:38 +01:00
2019-05-31 08:16:30 -07:00
2020-01-31 10:53:46 -08:00
2019-01-02 11:32:56 -08:00
2020-04-24 09:54:37 +05:30
2019-11-14 14:18:16 +08:00
2019-06-20 13:37:41 -07:00
2019-08-12 13:36:37 -04:00
2019-06-11 12:20:52 +02:00
2019-04-05 12:50:03 -07:00
2020-01-09 15:11:34 -08:00
2019-08-12 13:36:37 -04:00
2019-11-18 15:16:12 -08:00
2019-10-22 07:53:57 -07:00