Re: [syzbot] [hfs?] general protection fault in __hfsplus_setxattr

Edward Adam Davis
2026-04-15T02:08:18Z

#syz test

diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
index 452a1f9becb2..3e6f45b3259d 100644
--- a/fs/hfsplus/xattr.c
+++ b/fs/hfsplus/xattr.c
@@ -317,12 +317,14 @@ static int hfsplus_create_attributes_file(struct super_block *sb)
next_node++;
}

- hfsplus_mark_inode_dirty(HFSPLUS_ATTR_TREE_I(sb), HFSPLUS_I_ATTR_DIRTY);
hfsplus_mark_inode_dirty(attr_file, HFSPLUS_I_ATTR_DIRTY);

sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID);
if (!sbi->attr_tree)
pr_err("failed to load attributes file\n");
+ else
+ hfsplus_mark_inode_dirty(HFSPLUS_ATTR_TREE_I(sb),
+ HFSPLUS_I_ATTR_DIRTY);

failed_header_node_init:
kfree(buf);