Files
linux-stable-mirror/include/uapi/linux
Luca Boccassi c1f480b2d0 sed-opal: allow using IOC_OPAL_SAVE for locking too
Usually when closing a crypto device (eg: dm-crypt with LUKS) the
volume key is not required, as it requires root privileges anyway, and
root can deny access to a disk in many ways regardless. Requiring the
volume key to lock the device is a peculiarity of the OPAL
specification.

Given we might already have saved the key if the user requested it via
the 'IOC_OPAL_SAVE' ioctl, we can use that key to lock the device if no
key was provided here and the locking range matches, and the user sets
the appropriate flag with 'IOC_OPAL_SAVE'. This allows integrating OPAL
with tools and libraries that are used to the common behaviour and do
not ask for the volume key when closing a device.

Callers can always pass a non-zero key and it will be used regardless,
as before.

Suggested-by: Štěpán Horáček <stepan.horacek@gmail.com>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/r/20221206092913.4625-1-luca.boccassi@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-12-08 09:17:45 -07:00
..
2022-09-15 09:08:09 +02:00
2022-04-19 13:13:47 +01:00
2022-08-11 10:31:19 -07:00
2022-06-03 20:09:27 +08:00
2022-06-07 10:20:42 -07:00
2022-08-23 14:54:54 -05:00
2022-04-04 08:55:23 +02:00
2022-09-24 07:00:00 +02:00
2022-08-10 13:49:50 +01:00
2022-09-20 09:13:38 +02:00
2022-06-03 20:09:27 +08:00
2022-09-20 09:13:38 +02:00
2022-09-29 18:43:04 +02:00
2022-09-07 16:46:03 +02:00
2022-09-20 09:13:38 +02:00
2022-09-27 17:29:09 -07:00
2022-09-08 12:59:00 -06:00
2022-08-11 04:31:15 -04:00