mbox series

[v2,0/5] sed-opal: add command to read locking range attributes

Message ID 20230405111223.272816-1-okozina@redhat.com (mailing list archive)
Headers show
Series sed-opal: add command to read locking range attributes | expand

Message

Ondrej Kozina April 5, 2023, 11:12 a.m. UTC
This patch set aims to add ability to user authorities to read locking
range attributes.

It's achieved in two steps (except SUM enabled drives):

1) Patch IOC_OPAL_ADD_USR_TO_LR command so that user authority (together with
OPAL_ADMIN1) is added in ACE that allows getting locking range attributes.

2) Add new ioctl command IOC_OPAL_GET_LR_STATUS to get locking range
attributes to user authority assigned to specific locking range.

libcryptsetup plans to support OPAL2 drives and needs to verify locking
range parameters before device activation (LR unlock) takes place since
it's considered undesirable to have (for example) partition mapped beyond
locking range boundaries.

Changes since previous version:

v2:
  - Mostly code style fixes (overly long lines)
  - Refactored helper for adding user authorities in ACE (added boolean
    operators defines, explained addition of boolean ace operator
    when adding more than one user authority in ACE)

Ondrej Kozina (5):
  sed-opal: do not add same authority twice in boolean ace.
  sed-opal: add helper for adding user authorities in ACE.
  sed-opal: allow user authority to get locking range attributes.
  sed-opal: add helper to get multiple columns at once.
  sed-opal: Add command to read locking range parameters.

 block/opal_proto.h            |  10 ++
 block/sed-opal.c              | 301 +++++++++++++++++++++++++++++-----
 include/linux/sed-opal.h      |   1 +
 include/uapi/linux/sed-opal.h |  11 ++
 4 files changed, 280 insertions(+), 43 deletions(-)

Comments

Jens Axboe April 5, 2023, 1:46 p.m. UTC | #1
On Wed, 05 Apr 2023 13:12:18 +0200, Ondrej Kozina wrote:
> This patch set aims to add ability to user authorities to read locking
> range attributes.
> 
> It's achieved in two steps (except SUM enabled drives):
> 
> 1) Patch IOC_OPAL_ADD_USR_TO_LR command so that user authority (together with
> OPAL_ADMIN1) is added in ACE that allows getting locking range attributes.
> 
> [...]

Applied, thanks!

[1/5] sed-opal: do not add same authority twice in boolean ace.
      commit: 2fce95b196d34a17ac3f531933d156a8550d5b82
[2/5] sed-opal: add helper for adding user authorities in ACE.
      commit: 175b654402a11b01870e823f4eaa913b27ed8a63
[3/5] sed-opal: allow user authority to get locking range attributes.
      commit: 8be19a02f1e373d406b3d9e0c17a90c786c51c1f
[4/5] sed-opal: add helper to get multiple columns at once.
      commit: baf82b679cb2c76eb6f4b2881a60380e328ccc79
[5/5] sed-opal: Add command to read locking range parameters.
      commit: 4c4dd04e75e8177311d17387326253674cb0558b

Best regards,