[PATCH] erofs-utils: tar: fix multi-chunk metadata reads
Nithurshen
nithurshen.dev at gmail.com
Sat Mar 28 12:19:20 AEDT 2026
Hi Xiang,
The bug caused multi-chunk reads to overwrite the destination
buffer because the pointer did not advance. To verify the fix
was working correctly, we had to trigger a read larger than a
standard 512-byte tar block without hitting macOS path limits.
I generated a custom tarball using Python with a PAX header
containing an 800-character symlink target. This safely exceeded
the 512-byte chunk size to force a multi-chunk read.
Applied the patch to lib/tar.c and rebuilt erofs-utils.
Built an EROFS image from the tarball using mkfs.erofs.
Extracted the image using fsck.erofs and verified that the
extracted 800-character symlink was perfectly intact.
Without the patch, extraction failed entirely because the
symlink target was corrupted in memory. With the patch, the
pointer advanced correctly and the full string was preserved.
Tested-by: Nithurshen <nithurshen.dev at gmail.com>
Reviewed-by: Nithurshen <nithurshen.dev at gmail.com>
More information about the Linux-erofs
mailing list