Skip to content

Linux: add fs-verity uapi bindings - #5773

Open
hwjsnc wants to merge 1 commit into
rust-lang:mainfrom
hwjsnc:fs-verity
Open

hwjsnc wants to merge 1 commit into
rust-lang:mainfrom
hwjsnc:fs-verity

Conversation

@hwjsnc

@hwjsnc hwjsnc commented Nov 22, 2026

Copy link
Copy Markdown

Sources:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/uapi/linux/fsverity.h?id=07c99001312cbf90a357d4877a358f796eede65b
https://docs.kernel.org/filesystems/fsverity.html

Latest uapi introduced in kernel version 5.12.

Description

The linked commit is the one that introduced the current version of the uapi, which shipped in version 5.12 and remains unchanged as of kernel version 7.3.

Since the hash algo is either __u32, __u16, or __u8 in the structs I chose the smallest one for the ALGO constants. I'm not sure that's the best choice, maybe c_int would be better?

fs-verity should exist on android as well, but tests broke when I added it and I don't know what the problem is, nor am I terribly motivated to diagnose/fix it, so this commit introduces them only on target_os="linux".

Testing:
cargo test --workspace is clean except for some compiler warnings that were already present on main. ci/style.py reports "good style!". ci/verify-build.py was successful with stable toolchain, targets .*linux-(musl|gnu).*. I also ran a test program that enables/measures fs-verity against the new bindings, confirmed by the official fsverity-utils (x86_64-unknown-linux-gnu, Kernel version 6.18).

LLM disclosure: used for research&code review

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard
    doc comment
  • Tested locally (cargo test -p libc-test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot rustbot added O-linux S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 22, 2026
@rustbot

This comment has been minimized.

@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-linux S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants