linux/fs/hfs
Mehdi Ben Hadj Khelifa 3992198315 hfs: ensure sb->s_fs_info is always cleaned up
commit 05ce49a902 upstream.

When hfs was converted to the new mount api a bug was introduced by
changing the allocation pattern of sb->s_fs_info. If setup_bdev_super()
fails after a new superblock has been allocated by sget_fc(), but before
hfs_fill_super() takes ownership of the filesystem-specific s_fs_info
data it was leaked.

Fix this by freeing sb->s_fs_info in hfs_kill_super().

Cc: stable@vger.kernel.org
Fixes: ffcd06b6d1 ("hfs: convert hfs to use the new mount api")
Reported-by: syzbot+ad45f827c88778ff7df6@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ad45f827c88778ff7df6
Tested-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/20251201222843.82310-2-mehdi.benhadjkhelifa@gmail.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-02-16 10:13:32 +01:00
..
.kunitconfig hfs: introduce KUnit tests for HFS string operations 2025-11-19 14:53:59 -08:00
attr.c hfs: move hfs_xattr_handlers to .rodata 2023-10-09 16:24:19 +02:00
bfind.c hfs/hfsplus: prevent getting negative values of offset/length 2025-11-13 15:02:52 -08:00
bitmap.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bnode.c hfs/hfsplus: prevent getting negative values of offset/length 2025-11-13 15:02:52 -08:00
brec.c hfs/hfsplus: prevent getting negative values of offset/length 2025-11-13 15:02:52 -08:00
btree.c hfs/hfsplus updates for v6.19 2025-12-03 20:08:32 -08:00
btree.h hfs/hfsplus: move on-disk layout declarations into hfs_common.h 2025-11-25 15:16:03 -08:00
catalog.c hfs: fix potential use after free in hfs_correct_next_unused_CNID() 2025-11-06 11:07:16 -08:00
dir.c Change inode_operations.mkdir to return struct dentry * 2025-02-27 20:00:17 +01:00
extent.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
hfs.h hfs/hfsplus: move on-disk layout declarations into hfs_common.h 2025-11-25 15:16:03 -08:00
hfs_fs.h hfs/hfsplus: move on-disk layout declarations into hfs_common.h 2025-11-25 15:16:03 -08:00
inode.c hfs/hfsplus updates for v6.19 2025-12-03 20:08:32 -08:00
Kconfig hfs: introduce KUnit tests for HFS string operations 2025-11-19 14:53:59 -08:00
Makefile hfs: introduce KUnit tests for HFS string operations 2025-11-19 14:53:59 -08:00
mdb.c hfs: ensure sb->s_fs_info is always cleaned up 2026-02-16 10:13:32 +01:00
part_tbl.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.c hfs: introduce KUnit tests for HFS string operations 2025-11-19 14:53:59 -08:00
string_test.c hfs: introduce KUnit tests for HFS string operations 2025-11-19 14:53:59 -08:00
super.c hfs: ensure sb->s_fs_info is always cleaned up 2026-02-16 10:13:32 +01:00
sysdep.c Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
trans.c hfs: Fix OOB Write in hfs_asc2mac 2022-12-11 19:30:19 -08:00