linux/Documentation/block
Eric Biggers 1ebd4a3c09 blk-crypto: add ioctls to create and prepare hardware-wrapped keys
Until this point, the kernel can use hardware-wrapped keys to do
encryption if userspace provides one -- specifically a key in
ephemerally-wrapped form.  However, no generic way has been provided for
userspace to get such a key in the first place.

Getting such a key is a two-step process.  First, the key needs to be
imported from a raw key or generated by the hardware, producing a key in
long-term wrapped form.  This happens once in the whole lifetime of the
key.  Second, the long-term wrapped key needs to be converted into
ephemerally-wrapped form.  This happens each time the key is "unlocked".

In Android, these operations are supported in a generic way through
KeyMint, a userspace abstraction layer.  However, that method is
Android-specific and can't be used on other Linux systems, may rely on
proprietary libraries, and also misleads people into supporting KeyMint
features like rollback resistance that make sense for other KeyMint keys
but don't make sense for hardware-wrapped inline encryption keys.

Therefore, this patch provides a generic kernel interface for these
operations by introducing new block device ioctls:

- BLKCRYPTOIMPORTKEY: convert a raw key to long-term wrapped form.

- BLKCRYPTOGENERATEKEY: have the hardware generate a new key, then
  return it in long-term wrapped form.

- BLKCRYPTOPREPAREKEY: convert a key from long-term wrapped form to
  ephemerally-wrapped form.

These ioctls are implemented using new operations in blk_crypto_ll_ops.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Tested-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # sm8650
Link: https://lore.kernel.org/r/20250204060041.409950-4-ebiggers@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-02-10 09:54:19 -07:00
..
bfq-iosched.rst docs: block: Fix grammar and spelling mistakes in bfq-iosched.rst 2024-09-05 14:38:10 -06:00
biovecs.rst mm/page_io: introduce bio_first_folio_all() 2023-08-18 10:12:45 -07:00
blk-mq.rst docs: block: blk-mq.rst: correct places -> place 2023-09-22 05:30:21 -06:00
cmdline-partition.rst docs: block: Document support for read-only partition in cmdline part 2024-10-22 08:14:56 -06:00
data-integrity.rst block: move integrity information into queue_limits 2024-06-14 10:20:07 -06:00
deadline-iosched.rst docs: block: convert to ReST 2019-07-15 09:20:27 -03:00
index.rst Documentation/block: drop the request.rst file 2023-05-12 11:04:58 -06:00
inline-encryption.rst blk-crypto: add ioctls to create and prepare hardware-wrapped keys 2025-02-10 09:54:19 -07:00
ioprio.rst Documentation: block: ioprio: Update schedulers 2024-01-18 08:21:14 -07:00
kyber-iosched.rst docs: block: convert to ReST 2019-07-15 09:20:27 -03:00
null_blk.rst null_blk: add module parameters for 4 options 2022-08-02 17:14:50 -06:00
pr.rst Documentation: block: eliminate duplicated word 2020-07-13 09:44:05 -06:00
stat.rst docs: block: fix stat.rst document error 2021-06-04 11:23:36 -06:00
switching-sched.rst Documenation: switching-sched: Remove notes about elevator argument 2019-09-03 08:04:02 -06:00
ublk.rst Documentation: ublk: Drop Stefan Hajnoczi's message footnote 2025-01-28 15:02:17 -07:00
writeback_cache_control.rst block: fix spelling and grammar for in writeback_cache_control.rst 2024-06-20 06:53:14 -06:00