composefs / composefs/composefs

return value `-EWRONGVERITY` is not handled

Open
#425 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
689
Forks
56
PR merge metrics
No merged PRs in 30d

Description

I'm reading the composefs source code and see that the function

int lcfs_fd_measure_fsverity(uint8_t *digest, int fd)
may return -EWRONGVERITY

reference:
https://github.com/composefs/composefs/blob/c34cd5109f64be4d50446ab80a87b8f13772fd07/libcomposefs/lcfs-writer.c#L590

But that return value is not handled here

https://github.com/composefs/composefs/blob/c34cd5109f64be4d50446ab80a87b8f13772fd07/libcomposefs/lcfs-writer.c#L601-L618

Should it be?

Also errno is unspecified on line 609 if ioctl() succeeds on line 579
https://github.com/composefs/composefs/blob/c34cd5109f64be4d50446ab80a87b8f13772fd07/libcomposefs/lcfs-writer.c#L579

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in libcomposefs/lcfs-writer.c at the ioctl() call around line 579, then trace lcfs_fd_measure_fsverity() around line 590 and its caller handling at lines 601-618. Check how -EWRONGVERITY propagates and whether errno is read after successful ioctl(); done means the return and errno behavior are explicitly handled and covered by relevant verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.