Skip to content

lib: Add lcfs_fd_measure_fsverity#394

Merged
cgwalters merged 5 commits intocomposefs:mainfrom
cgwalters:add-fd-require-verity
Nov 19, 2024
Merged

lib: Add lcfs_fd_measure_fsverity#394
cgwalters merged 5 commits intocomposefs:mainfrom
cgwalters:add-fd-require-verity

Conversation

@cgwalters
Copy link
Copy Markdown
Contributor

@cgwalters cgwalters commented Nov 6, 2024

lib: Add lcfs_fd_measure_fsverity

Our history with fsverity APIs is a bit messy. For now historical
reasons lcfs_fd_get_fsverity tries to query the kernel (via ioctl)
but will silently fall back to userspace computation - which
is sometimes desirable, other times not.

We also have lcfs_fd_compute_fsverity which is unconditionally
userspace.

However some cases actually really want to require the
fd to have fsverity - so add an API to do that.

Signed-off-by: Colin Walters walters@verbum.org


writer: Canonicalize no-verity errno to -ENOVERITY

This is what we do elsewhere.

Signed-off-by: Colin Walters walters@verbum.org


lib/mount: Use lcfs_fd_measure_fsverity

This is ensuring we have our fsverity ioctl parsing code in
one place.

Signed-off-by: Colin Walters walters@verbum.org


rust: Bind lcfs_fd_measure_fsverity

This is a reasonable thing to want to do.

Signed-off-by: Colin Walters walters@verbum.org


@cgwalters cgwalters force-pushed the add-fd-require-verity branch from 1b3e9fc to 0c39a47 Compare November 6, 2024 01:39
@cgwalters cgwalters force-pushed the add-fd-require-verity branch from 0c39a47 to 955a594 Compare November 6, 2024 13:06
@cgwalters cgwalters changed the title lib: Add lcfs_fd_require_fsverity lib: Add lcfs_fd_measure_fsverity Nov 6, 2024
@cgwalters
Copy link
Copy Markdown
Contributor Author

test-lcfs: ../tests/test-lcfs.c:91: test_no_verity: Assertion `errsv == ENOVERITY' failed.

But only on s390x?? Hmm...

@cgwalters
Copy link
Copy Markdown
Contributor Author

Hummm I would bet money this is something like the run-on-arch action using qemu's userspace emulation which probably doesn't implement the ioctl so we're getting ENOSYS

@cgwalters cgwalters force-pushed the add-fd-require-verity branch 2 times, most recently from 272536b to 154ec89 Compare November 6, 2024 13:38
@cgwalters
Copy link
Copy Markdown
Contributor Author

OK, this passes CI now.

@cgwalters cgwalters enabled auto-merge November 6, 2024 15:31
Our history with fsverity APIs is a bit messy. For now historical
reasons lcfs_fd_get_fsverity tries to query the kernel (via ioctl)
but will silently fall back to userspace computation - which
is sometimes desirable, other times not.

We also have lcfs_fd_compute_fsverity which is unconditionally
userspace.

However some cases actually really want to require the
fd to have fsverity - so add an API to do that.

Signed-off-by: Colin Walters <walters@verbum.org>
This is what we do elsewhere.

Signed-off-by: Colin Walters <walters@verbum.org>
This is ensuring we have our fsverity ioctl parsing code in
one place.

Signed-off-by: Colin Walters <walters@verbum.org>
 We may get ENOSYS from qemu userspace emulation not implementing the ioctl.

Signed-off-by: Colin Walters <walters@verbum.org>
Adapted from an equivalent patch by Simon for ostree:
ostreedev/ostree@67ed2ac

Reported-by: Simon McVittie <smcv@debian.org>
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters merged commit 640eb95 into composefs:main Nov 19, 2024
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.

4 participants