From: Giulia Aloia <giulia@bynar.io>
To: almaz.alexandrovich@paragon-software.com
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
cenzhang@linux.microsoft.com
Subject: [PATCH 0/4] fs/ntfs3: tighten restart-table offset validation
Date: Mon, 21 Sep 2026 21:21:35 +0200 [thread overview]
Message-ID: <20260921192157.102738-1-giulia@bynar.io> (raw)
This series makes NTFS3 journal replay safer when the on-disk restart
tables contain inconsistent offsets.
Patch 1 checks open attribute offsets in the dirty-page walk. Patch 2
checks transaction and attribute offsets in check_log_rec(), including
nonzero attribute offsets in records without LCNs, and validates
allocator offsets against the on-disk open-attribute table entry size.
Patch 3 rejects restart-table dumps without a complete header, rejects
short open-attribute entries, and requires the transaction-table entry
size to match TRANSACTION_ENTRY.
Patch 4 bounds the free-list walk used when allocating a specific
restart table entry.
Cen Zhang's earlier patch [1] checks target_attr at the redo and undo
lookups. This series adds checks in the dirty-page walk, in log record
validation, and in the restart table allocator. It can be applied
independently of [1], but [1] is still needed for the additional
validation at the redo and undo lookups.
Greg KH asked on that thread why this should be fixed in the kernel
rather than in userspace fsck. Checking and repairing a filesystem
before mounting it remains the administrator's responsibility. These
patches serve a narrower purpose: if journal replay encounters an
invalid offset, it should return an error instead of accessing invalid
memory. They do not repair the filesystem or replace fsck. I am
proposing them as robustness improvements, consistent with the kernel
threat model [2].
Each patch includes a KASAN trace captured using a crafted image before
the fix. With the series applied, those images were re-mounted on the
same x86-64 KASAN build with no reports. The series builds clean with
W=1 after each patch and passes checkpatch.pl --strict with
GIT_COMMIT_ID ignored for the KASAN addresses.
[1] https://lore.kernel.org/all/20260901174934.6275-1-cenzhang@linux.microsoft.com/
[2] https://docs.kernel.org/process/threat-model.html
Giulia Aloia (4):
fs/ntfs3: validate dirty page open attribute offsets
fs/ntfs3: validate restart table offsets in log records
fs/ntfs3: validate on-disk restart tables before use
fs/ntfs3: fix out-of-bounds access in alloc_rsttbl_from_idx()
fs/ntfs3/fslog.c | 110 +++++++++++++++++++++++++++++++++++--------------------
1 file changed, 70 insertions(+), 40 deletions(-)
base-commit: 238650ef6c7c7cca08e032527329424c9fbd70e5
--
2.55.0
next reply other threads:[~2026-09-21 19:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 19:21 Giulia Aloia [this message]
2026-09-21 19:21 ` [PATCH 1/4] fs/ntfs3: validate dirty page open attribute offsets Giulia Aloia
2026-09-21 19:21 ` [PATCH 2/4] fs/ntfs3: validate restart table offsets in log records Giulia Aloia
2026-09-21 19:21 ` [PATCH 3/4] fs/ntfs3: validate on-disk restart tables before use Giulia Aloia
2026-09-21 19:21 ` [PATCH 4/4] fs/ntfs3: fix out-of-bounds access in alloc_rsttbl_from_idx() Giulia Aloia
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=20260921192157.102738-1-giulia@bynar.io \
--to=giulia@bynar.io \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=cenzhang@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
/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
all inboxes | Powered by JetHome®