[GIT PULL] hfs/hfsplus changes for 7.1-rc1

From: Viacheslav Dubeyko

Date: Fri Apr 10 2026 - 18:06:19 EST


Hello Linus,

This pull request contains several fixes of syzbot reported
issues and HFS+ fixes of xfstests failures.

Deepanshu Kartikey has fixed a syzbot reported issue of
a KMSAN uninit-value in hfsplus_strcasecmp(). The root
cause is that hfs_brec_read() doesn't validate that
the on-disk record size matches the expected size
for the record type being read. The fix introduced
hfsplus_brec_read_cat() wrapper that validates the record
size based on the type field and returns -EIO if size doesn't
match.

Shardul Bankar has fixed a syzbot reported issue of
processing corrupted HFS+ images where the b-tree
allocation bitmap indicates that the header node (Node 0) is free.
Node 0 must always be allocated. Violating this invariant leads
to allocator corruption, which cascades into kernel panics or
undefined behavior. Prevent trusting a corrupted allocator state
by adding a validation check during hfs_btree_open().
If corruption is detected, print a warning identifying the specific
corrupted tree and force the filesystem to mount read-only (SB_RDONLY).
This prevents kernel panics from corrupted images while enabling data
recovery.

Zilin Guan has fixed a potential deadlock in hfsplus_fill_super().
hfsplus_fill_super() calls hfs_find_init() to initialize a search
structure, which acquires tree->tree_lock. If the subsequent call to
hfsplus_cat_build_key() fails, the function jumps to the out_put_root
error label without releasing the lock. Fix this by adding the missing
hfs_find_exit(&fd) call before jumping to the out_put_root error label.
This ensures that tree->tree_lock is properly released on the error
path.

Yangtao Li has fixed the issue of not updating the change time
after file change. The fix updates file's ctime after rename in
hfsplus_rename().

The rest patches introduce the HFS+ fixes for the case of generic/348,
generic/728, generic/533, generic/523, and generic/642 test-cases of
xfstests suite.

The following changes since commit
6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f:

Linux 7.0-rc1 (2026-02-22 13:18:59 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/vdubeyko/hfs.git
tags/hfs-v7.1-tag1

for you to fetch changes up to
c1307d18caa819ddc28459d858eb38fdd6c3f8a0:

hfsplus: fix generic/642 failure (2026-04-08 14:23:29 -0700)

----------------------------------------------------------------
hfs/hfsplus updates for v7.1

- hfsplus: fix generic/642 failure
- hfsplus: rework logic of map nodes creation in xattr b-tree
- hfsplus: fix logic of alloc/free b-tree node
- hfsplus: fix error processing issue in hfs_bmap_free()
- hfsplus: fix potential race conditions in b-tree functionality
- hfsplus: extract hidden directory search into a helper function
- hfsplus: fix held lock freed on hfsplus_fill_super()
- hfsplus: fix generic/523 test-case failure
- hfsplus: validate b-tree node 0 bitmap at mount time
- hfsplus: refactor b-tree map page access and add node-type validation
- hfsplus: fix to update ctime after rename
- hfsplus: fix generic/533 test-case failure
- hfsplus: set ctime after setxattr and removexattr
- hfsplus: fix uninit-value by validating catalog record size
- hfsplus: fix potential Allocation File corruption after fsync

----------------------------------------------------------------
Deepanshu Kartikey (1):
hfsplus: fix uninit-value by validating catalog record size

Shardul Bankar (2):
hfsplus: refactor b-tree map page access and add node-type
validation
hfsplus: validate b-tree node 0 bitmap at mount time

Viacheslav Dubeyko (10):
hfsplus: fix potential Allocation File corruption after fsync
hfsplus: set ctime after setxattr and removexattr
hfsplus: fix generic/533 test-case failure
hfsplus: fix to update ctime after rename
hfsplus: fix generic/523 test-case failure
hfsplus: fix potential race conditions in b-tree functionality
hfsplus: fix error processing issue in hfs_bmap_free()
hfsplus: fix logic of alloc/free b-tree node
hfsplus: rework logic of map nodes creation in xattr b-tree
hfsplus: fix generic/642 failure

Zilin Guan (2):
hfsplus: fix held lock freed on hfsplus_fill_super()
hfsplus: extract hidden directory search into a helper function

fs/hfsplus/attributes.c | 44 +++++++--
fs/hfsplus/bfind.c | 51 ++++++++++
fs/hfsplus/bnode.c | 3 +
fs/hfsplus/brec.c | 32 +++---
fs/hfsplus/btree.c | 241 ++++++++++++++++++++++++++++++++++++-
--------
fs/hfsplus/catalog.c | 11 ++-
fs/hfsplus/dir.c | 23 ++++-
fs/hfsplus/extents.c | 7 ++
fs/hfsplus/hfsplus_fs.h | 26 ++++-
fs/hfsplus/inode.c | 42 +++++---
fs/hfsplus/super.c | 47 +++++++--
fs/hfsplus/unicode.c | 121 ++++++++++++++++-------
fs/hfsplus/unicode_test.c | 51 ++++++----
fs/hfsplus/xattr.c | 156 +++++++++++++++++++++++------
include/linux/hfs_common.h | 9 ++
15 files changed, 682 insertions(+), 182 deletions(-)