Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] ntfs: harden MFT record and attribute parsing
@ 2026-05-08 15:34 DaeMyung Kang
  2026-05-08 15:34 ` [PATCH 1/3] ntfs: validate MFT attrs_offset against bytes_in_use DaeMyung Kang
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: DaeMyung Kang @ 2026-05-08 15:34 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Hyunchul Lee, linux-fsdevel, linux-kernel

This series tightens fs/ntfs against malformed on-disk metadata and
fixes one off-by-one in the MFT bitmap scan.

Patches 1/3 and 3/3 are complementary: 1/3 rejects MFT records whose
attrs_offset points past bytes_in_use at record entry, and 3/3 moves
the per-attribute name bounds check earlier so it covers the AT_UNUSED
enumeration path that hands the name pointer back to callers.  Without
3/3, two enumeration paths can read past an attribute record: one in
fs/ntfs/attrib.c passes the returned name pointer to ntfs_attr_iget(),
and another in fs/ntfs/inode.c copies the name while building an
attribute list.

Patch 2/3 is independent: ntfs_mft_record_layout() rejects
mft_no >= 2^32, but the bitmap scan in
ntfs_mft_bitmap_find_and_alloc_free_rec_nolock() used '>'.  Bring it in
line with the other 2^32 boundary checks in fs/ntfs/mft.c.

All three carry the same Fixes tag (d3ad708fecaa) since the issues
date from the initial fs/ntfs commit in this tree.

DaeMyung Kang (3):
  ntfs: validate MFT attrs_offset against bytes_in_use
  ntfs: fix MFT bitmap scan 2^32 boundary check
  ntfs: validate attribute name bounds before returning it

 fs/ntfs/attrib.c | 25 +++++++++++++++++--------
 fs/ntfs/mft.c    | 16 ++++++++++++++--
 2 files changed, 31 insertions(+), 10 deletions(-)

--
2.34.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-05-09 15:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 15:34 [PATCH 0/3] ntfs: harden MFT record and attribute parsing DaeMyung Kang
2026-05-08 15:34 ` [PATCH 1/3] ntfs: validate MFT attrs_offset against bytes_in_use DaeMyung Kang
2026-05-08 15:34 ` [PATCH 2/3] ntfs: fix MFT bitmap scan 2^32 boundary check DaeMyung Kang
2026-05-09  4:03   ` Namjae Jeon
2026-05-09  6:14     ` CharSyam
2026-05-08 15:34 ` [PATCH 3/3] ntfs: validate attribute name bounds before returning it DaeMyung Kang
2026-05-09  6:12 ` [PATCH v2 0/3] ntfs: harden MFT record and attribute parsing DaeMyung Kang
2026-05-09 15:44   ` Namjae Jeon
2026-05-09  6:12 ` [PATCH v2 1/3] ntfs: validate MFT attrs_offset against bytes_in_use DaeMyung Kang
2026-05-09  6:12 ` [PATCH v2 2/3] ntfs: fix MFT bitmap scan 2^32 boundary check DaeMyung Kang
2026-05-09  6:12 ` [PATCH v2 3/3] ntfs: validate attribute name bounds before returning it DaeMyung Kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox