Skip to content

libcomposefs: detect short erofs files#333

Merged
cgwalters merged 1 commit intocomposefs:mainfrom
allisonkarlitskaya:read-complete-header
Sep 6, 2024
Merged

libcomposefs: detect short erofs files#333
cgwalters merged 1 commit intocomposefs:mainfrom
allisonkarlitskaya:read-complete-header

Conversation

@allisonkarlitskaya
Copy link
Copy Markdown
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
Copy Markdown
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 https://github.com/containers/storage/issues/2042

@cgwalters cgwalters merged commit b5d7f20 into composefs:main Sep 6, 2024
@cgwalters
Copy link
Copy Markdown
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