[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_DFFF86C192DEC64EC99B6EF96EDE4C986706@qq.com>
Date: Thu, 24 Jul 2025 23:08:26 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+41ba9c82bce8d7101765@...kaller.appspotmail.com
Cc: frank.li@...o.com,
glaubitz@...sik.fu-berlin.de,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
slava@...eyko.com,
syzkaller-bugs@...glegroups.com
Subject: [PATCH] hfs: Prevent the use of bnodes without entries
If the number of entries in the bnode is 0, the bnode is considered
invalid.
Reported-by: syzbot+41ba9c82bce8d7101765@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=41ba9c82bce8d7101765
Tested-by: syzbot+41ba9c82bce8d7101765@...kaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@...com>
---
fs/hfs/bfind.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/hfs/bfind.c b/fs/hfs/bfind.c
index ef9498a6e88a..1d6f2bbafa7a 100644
--- a/fs/hfs/bfind.c
+++ b/fs/hfs/bfind.c
@@ -133,6 +133,8 @@ int hfs_brec_find(struct hfs_find_data *fd)
goto invalid;
if (bnode->type != (--height ? HFS_NODE_INDEX : HFS_NODE_LEAF))
goto invalid;
+ if (!bnode->num_recs)
+ goto invalid;
bnode->parent = parent;
res = __hfs_brec_find(bnode, fd);
--
2.43.0
Powered by blists - more mailing lists