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