Skip to content

Conversation

@fellair
Copy link
Contributor

@fellair fellair commented Jun 12, 2025

A few things done here:

  • Add new block device ioctls (and structs) related to encryption, added in 1ebd4a3c095c ("blk-crypto: add ioctls to create and prepare hardware-wrapped keys"):
    BLKCRYPTOIMPORTKEY
    BLKCRYPTOGENERATEKEY
    BLKCRYPTOPREPAREKEY
  • Add and update new/missing syscalls' descriptions related to zoned block devices:
    BLKGETZONESZ
    BLKGETNRZONES
    BLKOPENZONE
    BLKCLOSEZONE
    BLKFINISHZONE
  • Add a few other missing syscalls, such as BLKRASET.
  • Fix some syscalls' directions (mostly, to 'inout').

Tested with make presubmit and local syzkaller instance with 'null_blk.zoned=1'. No descriptions were deleted, only modified.

P.S. To fully utilize zoned-related ioctls, we need to come up with a way to change /dev/nullb0 to zoned device and back.

Copy link
Collaborator

@a-nogikh a-nogikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Regarding null_blk.zoned=1 - if we set it on syzbot, we won't test the code that needs null_blk.zoned=0, right? Is it somehow possible to somehow test both?

If not, I guess we could set null_blk.zoned=1 on some of our instances. now I've noticed #6089 you opened

A few things done here:
- Add new block device ioctls (and structs) related to encryption,
added in 1ebd4a3c095c ("blk-crypto: add ioctls to create and
prepare hardware-wrapped keys"):
 BLKCRYPTOIMPORTKEY
 BLKCRYPTOGENERATEKEY
 BLKCRYPTOPREPAREKEY
Deviate slightly from original keys-related structs to ensure that
ioctl syscalls have preallocated buffers to work with, not merely
pointers that go nowhere.

- Add and update new/missing syscalls related to zoned block devices:
 BLKGETZONESZ
 BLKGETNRZONES
 BLKOPENZONE
 BLKCLOSEZONE
 BLKFINISHZONE

- Add a few other missing syscalls, such as BLKRASET.

- Fix some syscalls' directions (mostly, to 'inout').
@fellair fellair force-pushed the fellair_zonefs_block branch from 71cbd28 to 1156dd5 Compare June 16, 2025 14:11
@fellair
Copy link
Contributor Author

fellair commented Jun 16, 2025

v2:

  • updated blk_crypto* structs per comments above; that includes work with output buffers holding lt_key_ptr and eph_key_ptr. I am certain that those keys, depending on mode, may have sensible lower limits when it come to key sizes. Still, I opted for a variable length to account for weird user inputs.

We still need to figure out how to:

  • enable crypto ioctls properly. That implies device setup that has blk_crypto_profile initialized correctly - I will look into that.
  • enable null_blk as zoned. As mentioned above and in all: modify device driver parameters during fuzzing #6089, simply enabling null_blk.zoned=1 on some instances may negatively affect coverage. However, if maintainers agree, I don't mind doing that. All I need is to know what instances to patch configs in.

Copy link
Collaborator

@a-nogikh a-nogikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Shall we merge the PR now? Or did you want to include something else to this change set?

@fellair
Copy link
Contributor Author

fellair commented Jun 16, 2025

Thanks! Shall we merge the PR now? Or did you want to include something else to this change set?

Let's merge now, I'll figure out crypto ioctl issue separately, same goes for zoned null_blk. Thank you!

@a-nogikh a-nogikh added this pull request to the merge queue Jun 16, 2025
Merged via the queue into google:master with commit cfebc88 Jun 16, 2025
17 checks passed
@fellair fellair deleted the fellair_zonefs_block branch July 1, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants