You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-linux-kernel/patches.fixes/hfs-avoid-crash-in-hfs_bnod...

31 lines
887 B

From: Jeff Mahoney <jeffm@suse.com>
Subject: hfs: avoid crash in hfs_bnode_create
Patch-mainline: not yet
References: bnc#552250
Commit 634725a92938b0f282b17cec0b007dca77adebd2 removed the BUG_ON
in hfs_bnode_create in hfsplus. This patch removes it from the hfs
version and avoids an fsfuzzer crash.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
---
fs/hfs/bnode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -413,7 +413,11 @@ struct hfs_bnode *hfs_bnode_create(struc
spin_lock(&tree->hash_lock);
node = hfs_bnode_findhash(tree, num);
spin_unlock(&tree->hash_lock);
- BUG_ON(node);
+ if (node) {
+ printk(KERN_CRIT "new node %u already hashed?\n", num);
+ WARN_ON(1);
+ return node;
+ }
node = __hfs_bnode_create(tree, num);
if (!node)
return ERR_PTR(-ENOMEM);