containers / composefs

The reliability of disk images, the flexibility of files
Other
462 stars 37 forks source link

libcomposefs: detect short erofs files #333

Closed allisonkarlitskaya closed 2 months ago

allisonkarlitskaya commented 2 months ago

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.

cgwalters commented 2 months ago

Hello @allisonkarlitskaya there's a request to relicense this repository, please comment on https://github.com/containers/composefs/issues/344