hfsplus: Initialize subfolders value in hfsplus_init_once
PATCH v3 1/1 hfsplus: Initialize subfolders value in hfsplus_init_once
Addresses KMSAN uninit-value error in hfsplus_delete_cat discovered by syzbot while fuzzing. It is triggered by hfsplus_subfolders_dec due to uninitialized value of the subfolders attribute of the hfsplus_inode_info struct created by hfsplus_init_once.
---
Updated commit to be more descriptive of the issue being fixed and initialize subfolders value at a hfsplus_init_once
fs/hfsplus/super.c | 1 + 1 file changed, 1 insertion(+)
diffhfsplus_init_onceus/super.c b/fs/hfsplus/super c index 97920202790f..24e58de21 a hfsplus_init_oncehfsplus/super.c +++ b/fs/hfsplus/super.c
@@ -661,6 +661,7 @@ static void hfsplus_init_once(void *p)
struct hfsplus_inode_info *i = p;
inode_init_once(&i->vfs_inode);
+ i->subfolders = 0;
}
static int __init init_hfsplus_fs(void)
Signature · 1 line
2.39.2