linux/fs/hfsplus
Linus Torvalds 0de672c7e1 hfs/hfsplus updates for v7.3
- hfsplus: validate extent record length before writing it back
 - hfsplus: validate B-tree record offset table
 - hfs: rework MDB locking scheme
 - fs: hfsplus: remove redundant NULL check before kfree()
 - hfs: port HFS+ b-tree bitmap corruption check
 - hfs: don't re-dirty MDB buffers after a write failure
 - hfsplus: fix error code when writing beyond volume capacity
 - hfs: fix error code when writing beyond volume capacity
 - hfsplus: validate thread record before delete key rebuild
 - hfs: validate catalog CNIDs before instantiating inodes
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQT4wVoLCG92poNnMFAhI4xTh21NnQUCan+JtwAKCRAhI4xTh21N
 ndwRAQCo1yRn8Dt1H1ecRH1aXFEceQ1IiDRyklA/0sdXE1iRcAD9Gh5mUvXKvkww
 TYTKWgFlqBZTODeAhD5kV/Vqai0AAAQ=
 =9ixe
 -----END PGP SIGNATURE-----

Merge tag 'hfs-v7.3-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/vdubeyko/hfs

Pull HFS updates from Viacheslav Dubeyko:
 "This contains several fixes in HFS/HFS+ of syzbot reported issues and
  HFS/HFS+ fixes of xfstests failures.

   - b-tree bitmap corruption check (Aditya Prakash Srivastava)

     During b-tree open (hfs_btree_open()), the code verifies that the
     allocation map bit for the tree header (node 0) is set. If not, it
     indicates a corrupted map record/bitmap and mounts the volume as
     read-only (SB_RDONLY) to prevent further damage.

   - Validate catalog CNIDs before instantiating inodes (David
     Maximiliano Hermitte)

     The hfs_cat_find_brec() first resolves a catalog thread record by
     CNID and then looks up the corresponding catalog record by
     parent/name. On a corrupted filesystem image, the second lookup may
     find a record whose CNID does not match the CNID that was
     requested. Finally, corrupted catalog records are rejected.

   - Validate B-tree record offset table (Jiaming Zhang)

     A crafted HFS+ image can contain a corrupted B-tree node. The node
     descriptor may contain a record count that does not fit in the
     node, and record offsets may be unordered, unaligned, outside the
     node, or point into the offset table itself. Validate num_recs
     against the node size before walking the record offset table.
     Reject record ranges that are unordered, unaligned, outside the
     node, or overlapping the offset table. Reject invalid record
     indexes before reading their offset entries, and avoid decrementing
     an already-zero leaf_count.

   - Refactoring of hfsplus_delete_cat() logic (Kyle Zeng).

     The hfsplus_delete_cat() is called with str == NULL when the last
     open reference to an unlinked HFS+ hardlink backing inode is
     closed. In that case, the function finds the catalog thread by CNID
     and rebuilds the catalog key from thread.nodeName. A corrupted
     image can therefore provide an oversized thread name length and
     make hfs_bnode_read() write past the catalog search-key allocation.
     Read the CNID record through hfsplus_brec_read_cat(), which bounds
     the record read to sizeof(hfsplus_cat_entry) and verifies that a
     thread record's size exactly matches nodeName.length.

   - Cleanup in KUnit test (Mohammad Shahid)

     The kfree() safely handles NULL pointers, so the explicit NULL
     check in free_mock_str_env() before calling kfree() is unnecessary.

  The rest contain fixes of generic/564 xfstests' test-case failure
  for the case of HFS+ file system, syzbot reported issue in
  hfs_mdb_commit() and hfs_mdb_close() methods of HFS file system,
  and reworking the MDB locking scheme in HFS file system"

* tag 'hfs-v7.3-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/vdubeyko/hfs:
  hfsplus: validate extent record length before writing it back
  hfsplus: validate B-tree record offset table
  hfs: rework MDB locking scheme
  fs: hfsplus: remove redundant NULL check before kfree()
  hfs: port HFS+ b-tree bitmap corruption check
  hfs: don't re-dirty MDB buffers after a write failure
  hfsplus: fix error code when writing beyond volume capacity
  hfs: fix error code when writing beyond volume capacity
  hfsplus: validate thread record before delete key rebuild
  hfs: validate catalog CNIDs before instantiating inodes
2026-08-17 18:14:32 -07:00
..
.kunitconfig hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
attributes.c hfs/hfsplus updates for v7.1 2026-04-13 16:50:38 -07:00
bfind.c hfsplus: validate B-tree record offset table 2026-08-11 16:22:26 -07:00
bitmap.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bnode.c hfsplus: validate B-tree record offset table 2026-08-11 16:22:26 -07:00
brec.c hfsplus: validate B-tree record offset table 2026-08-11 16:22:26 -07:00
btree.c hfsplus: validate B-tree record offset table 2026-08-11 16:22:26 -07:00
catalog.c hfsplus: validate thread record before delete key rebuild 2026-07-14 10:23:20 -07:00
dir.c vfs-7.3-rc1.misc 2026-08-17 12:56:12 -07:00
extents.c hfsplus: validate extent record length before writing it back 2026-08-11 16:37:16 -07:00
hfsplus_fs.h hfsplus: validate B-tree record offset table 2026-08-11 16:22:26 -07:00
hfsplus_raw.h hfs/hfsplus: move on-disk layout declarations into hfs_common.h 2025-11-25 15:16:03 -08:00
inode.c hfsplus: fix error code when writing beyond volume capacity 2026-07-14 10:25:39 -07:00
ioctl.c vfs: rename parent_ino to d_parent_ino and make it use RCU 2024-06-27 18:34:21 +02:00
Kconfig hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
Makefile hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
options.c fs: inline current_umask() and move it to fs_struct.h 2025-11-05 22:51:23 +01:00
part_tbl.c fs/hfsplus: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
super.c hfsplus: Move long delayed work on system_dfl_long_wq 2026-07-31 10:09:07 +02:00
tables.c
unicode_test.c fs: hfsplus: remove redundant NULL check before kfree() 2026-07-27 18:07:37 -07:00
unicode.c hfsplus: fix generic/523 test-case failure 2026-03-25 12:38:11 -07:00
wrapper.c hfsplus: use bdev_rw_virt in hfsplus_submit_bio 2025-05-07 07:31:08 -06:00
xattr_security.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_trusted.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_user.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr.c hfsplus: Remove the duplicate attr inode dirty marking action 2026-04-27 15:22:17 -07:00
xattr.h hfsplus: move hfsplus_xattr_handlers to .rodata 2023-10-09 16:24:19 +02:00