linux/fs/hfs
Mehdi Ben Hadj Khelifa 46c1d56ad3 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:19:44 +01:00
..
attr.c hfs: move hfs_xattr_handlers to .rodata 2023-10-09 16:24:19 +02:00
bfind.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bitmap.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bnode.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
brec.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
btree.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
btree.h hfs: add lock nesting notation to hfs_find_init 2021-07-15 10:13:49 -07:00
catalog.c hfs: fix potential use after free in hfs_correct_next_unused_CNID() 2025-12-18 14:02:52 +01: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 address hfs on-disk corruption robustness review comments 2008-02-06 10:41:05 -08:00
hfs_fs.h hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
inode.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mdb.c hfs: ensure sb->s_fs_info is always cleaned up 2026-02-16 10:19:44 +01:00
part_tbl.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.c get rid of 'parent' argument of ->d_compare() 2016-07-31 16:37:25 -04:00
super.c hfs: ensure sb->s_fs_info is always cleaned up 2026-02-16 10:19:44 +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