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-01-22 21:40:33 +01:00
2020-01-14 20:07:03 +01:00
2019-09-10 10:33:53 +01:00
2018-12-10 11:09:45 -08:00
2020-03-10 11:07:35 -07:00
2019-03-13 15:01:42 +05:30
2020-05-18 16:26:04 +05:30
2019-11-19 15:19:46 +08:00
2020-01-27 14:50:42 +01:00
2018-12-10 11:09:45 -08:00
2019-12-17 20:35:45 +01:00
2020-01-27 14:51:03 +01:00
2020-05-23 05:08:22 -07:00
2019-12-13 08:52:21 +01:00
2020-05-23 05:08:22 -07:00
2019-06-06 13:57:14 +08:00
2019-08-06 16:09:54 -07:00
2020-05-23 05:08:22 -07:00
2020-02-01 09:37:10 +00:00
2019-02-27 10:08:52 +01:00
2020-02-07 13:05:47 +05:30
2020-05-23 05:08:22 -07:00
2020-05-23 05:08:22 -07:00
2019-01-16 20:56:01 -08:00
2020-04-08 21:48:34 +05:30
2020-05-02 17:59:16 +05:30
2020-01-28 03:10:58 -08:00
2020-05-23 05:08:22 -07:00
2020-01-27 14:51:00 +01:00
2020-02-01 21:12:37 -08:00
2020-01-09 10:19:01 +01:00
2019-12-13 08:52:59 +01:00
2019-03-05 17:58:50 +01:00
2018-12-19 18:38:58 +05:30
2019-07-24 11:37:50 -07:00
2020-04-24 15:22:03 -07:00
2020-04-24 15:21:22 -07:00
2019-12-01 09:17:07 +01:00
2019-06-09 09:17:11 +02:00
2019-04-17 08:38:51 +02:00
2020-04-24 15:22:03 -07:00
2020-07-08 10:19:08 -07:00
2019-10-05 13:10:03 +02:00
2020-04-24 15:19:09 -07:00
2019-12-05 09:21:08 +01:00
2020-05-04 10:48:20 -07:00
2019-11-13 16:06:14 +05:30
2019-01-31 08:14:41 +01:00
2019-07-03 13:14:48 +02:00
2019-05-25 18:23:48 +02:00
2019-10-14 00:52:41 -07:00
2020-04-24 15:19:09 -07:00
2019-08-16 10:12:38 +02:00
2019-05-20 19:40:50 -07:00
2019-08-11 15:21:36 +02:00
2020-05-23 05:08:22 -07:00
2020-03-27 10:48:20 -07:00
2019-08-06 19:06:52 +02:00
2019-08-06 19:06:52 +02:00
2019-05-24 03:54:56 -07:00
2020-03-27 10:48:20 -07:00
2020-03-27 10:48:20 -07:00
2019-10-10 16:35:59 +00:00
2019-02-27 10:08:53 +01:00
2020-03-16 23:09:43 -07:00
2018-12-10 11:09:45 -08:00
2020-03-27 10:48:20 -07:00
2020-03-15 19:42:35 +08:00
2020-03-27 10:48:20 -07:00
2019-03-11 15:29:33 -06:00
2020-01-28 01:25:51 -08:00
2019-11-20 18:47:11 +01:00
2019-03-06 16:02:06 +00:00
2020-02-03 21:39:14 -08:00
2019-09-05 18:56:52 +05:30
2019-11-25 10:00:42 +01:00
2019-01-02 11:37:54 -08:00
2020-02-10 14:24:47 +05:30
2019-07-31 07:27:11 +02:00
2020-04-24 15:24:08 -07:00
2019-07-31 21:34:30 -07:00
2020-04-13 11:52:22 -07:00
2019-03-21 16:25:26 -07:00
2019-01-17 14:37:23 -08:00
2020-04-24 15:22:03 -07:00
2020-05-23 05:08:22 -07:00
2020-06-09 15:35:49 +05:30
2019-03-12 19:01:54 -07:00
2020-06-19 14:24:29 +05:30
2019-12-13 17:16:03 -08:00
2020-06-05 14:27:37 +05:30
2020-01-28 03:22:36 -08:00
2020-02-24 08:34:44 +01:00
2019-06-04 08:02:34 +02:00
2019-11-20 18:47:40 +01:00
2019-05-16 19:41:22 +02:00
2019-11-12 10:59:29 +05:30
2019-09-23 14:44:14 +05:30
2019-06-21 10:01:34 -07:00
2020-02-11 04:34:08 -08:00
2020-05-18 16:26:08 +05:30
2020-02-28 03:35:57 +00:00
2020-06-17 06:00:22 +05:30
2019-03-15 17:23:07 -07:00
2019-10-08 09:21:03 -07:00
2020-04-24 15:19:09 -07:00
2018-12-17 09:24:38 +01:00
2020-07-08 22:40:37 +05:30
2019-11-20 18:45:55 +01:00
2020-02-13 15:14:14 -08:00
2019-05-20 19:40:50 -07:00
2019-12-01 09:17:38 +01:00
2019-12-03 16:08:50 -08:00
2019-12-05 09:21:03 +01:00
2019-05-31 06:46:18 -07:00
2019-02-12 19:47:14 +01:00
2020-05-23 05:08:22 -07:00
2019-09-10 10:33:44 +01:00
2019-03-23 20:10:08 +01:00
2019-03-26 09:16:02 -07:00
2019-02-12 19:47:24 +01:00
2018-12-05 19:32:13 +01:00
2020-03-05 16:42:18 +01:00
2020-03-04 12:01:17 -08:00
2019-01-13 09:51:04 +01:00
2019-07-31 07:26:59 +02:00
2020-02-03 21:40:32 -08:00
2019-12-17 20:35:45 +01:00
2019-04-01 00:21:10 -07:00
2019-05-22 07:37:40 +02:00
2020-05-11 10:27:22 -07:00
2019-10-17 13:45:42 -07:00
2019-11-20 18:47:31 +01:00
2020-05-27 00:27:18 +05:30
2019-05-08 07:21:43 +02:00
2019-12-05 09:19:39 +01:00
2019-10-11 18:21:43 +02:00
2019-03-05 17:58:51 +01:00
2020-01-12 12:17:25 +01:00
2019-08-09 17:52:34 +02:00
2020-01-28 03:13:32 -08:00
2020-03-27 10:48:20 -07:00
2020-03-12 10:46:18 -07:00
2019-11-20 18:45:19 +01:00
2020-02-28 16:38:59 +01:00
2019-01-02 12:45:39 -08:00
2020-01-29 14:07:18 +05:30
2020-03-27 10:48:20 -07:00
2020-03-12 08:30:15 +05:30
2020-03-27 19:47:55 +05:30
2018-12-10 11:09:45 -08:00
2020-06-09 11:40:59 +05:30
2019-09-05 09:04:29 -07:00
2019-11-07 13:17:16 +02:00
2020-04-09 09:01:36 -07:00
2018-12-10 11:09:45 -08:00
2019-12-31 16:35:23 +01:00
2020-03-09 11:32:04 -07:00
2019-04-05 22:33:09 +02:00
2020-05-23 05:08:22 -07:00
2019-12-13 08:52:43 +01:00
2019-06-04 08:02:34 +02:00
2019-06-04 08:02:34 +02:00
2019-09-24 17:44:15 -07:00
2019-09-24 17:44:13 -07:00
2019-01-09 11:00:11 -08:00
2019-04-20 09:15:59 +02:00
2020-01-15 14:51:23 +00:00
2019-07-21 09:03:11 +02:00
2019-12-13 10:01:10 +01:00
2019-03-23 20:09:48 +01:00
2020-05-23 05:08:22 -07:00
2020-07-08 10:19:08 -07:00
2019-02-14 11:59:21 -08:00
2019-12-05 09:20:26 +01:00
2019-03-22 23:07:04 +00:00
2020-02-11 04:34:17 -08:00
2020-02-26 02:03:42 -08:00
2020-04-01 12:54:12 +05:30
2020-02-28 16:39:00 +01:00
2020-01-04 19:13:15 +01:00
2020-01-26 19:04:49 +00:00
2019-06-09 09:17:19 +02:00
2020-02-24 08:34:46 +01:00
2019-05-24 03:55:45 -07:00
2019-12-06 01:18:09 -08:00
2020-02-01 14:39:37 +00:00
2019-09-06 10:22:19 +02:00
2020-04-24 15:19:09 -07:00
2018-12-29 13:37:59 +01:00
2020-06-17 06:00:22 +05:30
2020-06-17 06:00:22 +05:30
2020-05-23 05:08:22 -07:00
2019-04-17 08:38:51 +02:00
2020-05-23 05:08:22 -07:00
2020-01-29 16:43:27 +01:00
2019-01-13 09:51:04 +01:00
2020-06-10 23:48:02 -07:00
2019-03-29 03:09:17 -07:00
2019-12-31 16:35:38 +01:00
2019-04-25 01:16:00 -07:00
2020-01-28 01:25:51 -08:00
2020-04-26 04:01:40 -07:00
2020-05-23 05:08:22 -07:00
2020-02-03 21:39:14 -08:00
2020-03-27 10:48:20 -07:00
2019-05-31 08:16:30 -07:00
2019-01-09 17:38:42 +01:00
2019-09-10 16:28:55 -06:00
2018-12-10 11:09:45 -08:00
2018-12-10 11:09:45 -08:00
2018-12-10 11:09:45 -08:00
2019-11-18 21:05:28 -08:00
2020-01-31 10:53:46 -08:00
2019-02-01 12:37:40 -08:00
2018-12-10 11:09:45 -08:00
2020-05-08 11:15:28 +05:30
2020-01-20 18:46:53 -08:00
2018-12-10 11:09:45 -08:00
2018-12-10 11:09:45 -08:00
2018-12-10 11:09:45 -08:00
2018-12-20 17:43:16 -08:00
2020-01-29 18:00:03 +00:00
2019-02-23 09:07:25 +01:00
2020-05-23 05:08:22 -07:00
2019-06-04 08:02:34 +02:00
2019-06-04 08:02:34 +02:00
2019-01-30 12:43:25 +05:30
2019-09-06 10:22:22 +02:00
2019-09-06 10:22:23 +02:00
2019-01-02 11:32:56 -08:00
2020-01-29 16:43:26 +01:00
2020-01-09 10:18:54 +01:00
2019-07-14 21:00:20 -07:00
2019-07-14 21:01:09 -07:00
2019-08-07 12:39:31 -07:00
2020-03-12 10:46:18 -07:00
2020-04-24 09:54:37 +05:30
2020-03-09 11:32:04 -07:00
2019-01-16 20:56:01 -08:00
2020-01-27 14:50:37 +01:00
2019-11-04 15:38:05 -08:00
2019-05-31 06:46:30 -07:00
2019-10-23 20:12:39 -07:00
2019-09-24 17:44:13 -07:00
2019-11-14 14:18:16 +08:00
2020-04-16 15:56:53 +05:30
2020-03-09 11:32:05 -07:00
2020-02-11 04:34:11 -08:00
2020-06-01 03:37:43 -07:00
2019-06-20 13:37:41 -07:00
2019-08-12 13:36:37 -04:00
2019-05-04 09:20:11 +02:00
2019-05-07 11:30:03 +05:30
2020-01-27 14:50:26 +01:00
2020-05-23 05:22:24 -07:00
2019-10-11 13:52:04 -07:00
2019-09-10 20:04:59 -07:00
2020-01-17 19:46:55 +01:00
2020-01-04 19:13:35 +01:00
2020-04-20 22:28:20 +05:30
2019-08-12 13:36:37 -04:00
2020-03-12 14:22:55 -07:00
2019-11-04 15:38:05 -08:00
2019-11-04 15:38:05 -08:00
2019-06-11 12:20:52 +02:00
2019-01-09 17:38:33 +01:00
2019-07-18 07:43:59 -07:00
2019-12-13 08:52:28 +01:00
2019-08-02 11:14:36 -07:00
2020-03-29 23:39:12 -07:00
2019-04-05 12:50:03 -07:00
2020-01-04 19:12:53 +01:00
2019-12-17 20:35:17 +01:00
2020-02-19 14:34:34 -08:00
2020-02-24 08:34:46 +01:00
2019-07-26 09:14:07 +02:00
2019-05-16 16:07:15 -07:00
2019-09-11 01:46:49 -07:00
2019-04-05 22:32:56 +02:00
2019-12-05 09:19:38 +01:00
2019-04-05 22:32:56 +02:00
2019-05-06 11:44:49 -07:00
2019-03-14 13:31:07 -07:00
2020-01-27 14:50:37 +01:00
2019-05-24 15:32:11 +08:00
2019-05-31 04:45:01 -07:00
2020-05-23 05:08:22 -07:00
2019-11-27 12:37:25 -08:00
2019-02-01 17:08:00 -08:00
2019-06-03 14:55:48 -07:00
2020-04-24 15:19:09 -07:00
2020-03-13 15:27:58 +00:00
2019-12-05 09:20:25 +01:00
2019-12-13 08:51:07 +01:00
2018-12-10 11:09:45 -08:00
2020-01-27 14:51:05 +01:00
2019-06-04 08:02:30 +02:00
2020-01-04 19:13:30 +01:00
2019-09-24 17:44:13 -07:00
2019-12-13 14:05:00 -08:00
2019-05-31 06:46:16 -07:00
2020-01-09 15:11:34 -08:00
2019-03-13 14:02:35 -07:00
2019-11-18 14:02:15 -05:00
2020-01-28 03:20:43 -08:00
2020-01-27 14:50:22 +01:00
2019-08-12 13:36:37 -04:00
2019-11-18 15:16:12 -08:00
2018-12-29 13:37:55 +01:00
2019-10-22 07:53:57 -07:00
2020-04-14 04:48:53 -07:00
2019-05-31 06:46:29 -07:00
2019-12-21 10:57:17 +01:00
2019-11-20 18:45:24 +01:00
2019-01-13 23:39:23 -08:00
2020-01-23 08:21:32 +01:00
2019-07-31 10:20:01 +05:30
2020-01-28 03:20:43 -08:00
2018-12-08 12:59:07 +01:00
2020-05-23 05:08:22 -07:00
2019-01-02 10:56:07 -08:00
2019-09-24 17:44:16 -07:00
2019-02-06 10:21:49 -07:00
2020-02-28 03:35:36 +00:00
2019-09-22 15:39:09 -07:00
2019-02-27 10:09:01 +01:00
2019-04-17 08:38:52 +02:00
2019-06-11 14:23:31 +05:30
2019-12-25 01:31:56 -08:00
2019-04-24 14:55:01 +05:30
2019-07-14 08:11:21 +02:00
2019-11-06 15:27:46 +00:00