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.