Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcomposefs: detect short erofs files #333

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

allisonkarlitskaya
Copy link
Collaborator

When attempting to read the header of the erofs file before mounting it, we verify that the read is successful, but not that the full header has been returned. We then proceed to access the header, which means we could be reading uninitialized memory.

Add a check to verify that we've read the full header. If not, return -EINVAL, which is what we already return in case the header was incorrect.

When attempting to read the header of the erofs file before mounting it,
we verify that the read is successful, but not that the full header has
been returned.  We then proceed to access the header, which means we
could be reading uninitialized memory.

Add a check to verify that we've read the full header.  If not, return
-EINVAL, which is what we already return in case the header was
incorrect.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Copy link
Contributor

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

ooo 🙈 Nice find!

I wonder if this one might also be related to containers/storage#2042

@cgwalters cgwalters merged commit b5d7f20 into containers:main Sep 6, 2024
13 checks passed
@cgwalters
Copy link
Contributor

Hello @allisonkarlitskaya there's a request to relicense this repository, please comment on #344

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