]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hfs: ensure sb->s_fs_info is always cleaned up
authorMehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com>
Mon, 1 Dec 2025 22:23:06 +0000 (23:23 +0100)
committerViacheslav Dubeyko <slava@dubeyko.com>
Mon, 15 Dec 2025 23:18:26 +0000 (15:18 -0800)
commit05ce49a902be15dc93854cbfc20161205a9ee446
treec5452061e0cecf4b2d9300d1b2057cef240d3469
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
hfs: ensure sb->s_fs_info is always cleaned up

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: ffcd06b6d13b ("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>
fs/hfs/mdb.c
fs/hfs/super.c