]> git.ipfire.org Git - thirdparty/linux.git/commit
hfs: Replace BUG_ON with error handling for CNID count checks
authorJori Koolstra <jkoolstra@xs4all.nl>
Sat, 20 Dec 2025 19:10:06 +0000 (20:10 +0100)
committerViacheslav Dubeyko <slava@dubeyko.com>
Tue, 6 Jan 2026 20:39:19 +0000 (12:39 -0800)
commitb226804532a875c10276168dc55ce752944096bd
tree3fb0cc9b669ac4a5b3f64b6866a7485af2b22dc0
parent413466f3f0f84e7356da16c611afd69d2a0872e4
hfs: Replace BUG_ON with error handling for CNID count checks

In a06ec283e125 next_id, folder_count, and file_count in the super block
info were expanded to 64 bits, and BUG_ONs were added to detect
overflow. This triggered an error reported by syzbot: if the MDB is
corrupted, the BUG_ON is triggered. This patch replaces this mechanism
with proper error handling and resolves the syzbot reported bug.

Singed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
Reported-by: syzbot+17cc9bb6d8d69b4139f0@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=17cc9bb6d8d69b4139f0
Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/20251220191006.2465256-1-jkoolstra@xs4all.nl
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
fs/hfs/dir.c
fs/hfs/hfs_fs.h
fs/hfs/inode.c
fs/hfs/mdb.c
fs/hfs/super.c