public inbox for linux-erofs@ozlabs.org
 help / color / mirror / Atom feed
From: Nithurshen <nithurshen.dev@gmail.com>
To: ch@vnsh.in
Cc: linux-erofs@lists.ozlabs.org, xiang@kernel.org,
	Nithurshen <nithurshen.dev@gmail.com>
Subject: Re: [PATCH] erofs-utils: tar: fix multi-chunk metadata reads
Date: Sat, 28 Mar 2026 06:49:20 +0530	[thread overview]
Message-ID: <20260328011920.86705-1-nithurshen.dev@gmail.com> (raw)
In-Reply-To: <20260326103254.32152-1-ch@vnsh.in>

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@gmail.com>
Reviewed-by: Nithurshen <nithurshen.dev@gmail.com>


      parent reply	other threads:[~2026-03-28  1:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 10:32 [PATCH] erofs-utils: tar: fix multi-chunk metadata reads Vansh Choudhary
2026-03-28  0:57 ` Ajay Rajera
2026-03-28  1:19 ` Nithurshen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260328011920.86705-1-nithurshen.dev@gmail.com \
    --to=nithurshen.dev@gmail.com \
    --cc=ch@vnsh.in \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=xiang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox