hfsplus: Initialize directory subfolders in hfsplus_mknod
Subsystems (2)
PATCH v2 1/1 hfsplus: Initialize directory subfolders in hfsplus_mknod
Addresses uninitialized subfolders attribute being used in hfsplus_subfolders_inc and hfsplus_subfolders_dec.
Reported-by [email protected]
Signed-off-by Siddharth Menon <[email protected]>
---
Removed changes that was accidentally added while debugging and reformatted the message.
fs/hfsplus/dir.c | 3 +++ 1 file changed, 3 insertions(+)
644
fs/hfsplus/dir.c +3 -0
@@ -485,6 +485,9 @@ static int hfsplus_mknod(struct mnt_idmap *idmap, struct inode *dir,mutex_lock (&sbi->vh_mutex); inode =hfsplus_new_inode (dir->i_sb, dir, mode); +if (test_bit (HFSPLUS_SB_HFSX , &sbi->flags)) +HFSPLUS_I (dir)->subfolders =0 ; +if (!inode) goto out;
Signature · 1 line
2.39.2
Quoted 2 lines · Siddharth Menon
Addresses uninitialized subfolders attribute being used in
hfsplus_subfolders_incandhfsplus_subfolders_dec.
This is a really poor commit message. It needs to be more descriptive. How can this happen? Is it just a fuzzing thing?
Quoted 27 lines
Reported-by [email protected]Signed-off-by Siddharth Menon <[email protected]>---
Removed changes that was accidentally added while debugging and reformatted the message.fs/hfsplus/dir.c | 3 +++ 1 file changed, 3 insertions(+)644
fs/hfsplus/dir.c +3
-0@@ -485,6 +485,9 @@ static int hfsplus_mknod(struct mnt_idmap *idmap, struct inode *dir,mutex_lock (&sbi->vh_mutex); inode =hfsplus_new_inode (dir->i_sb, dir, mode); +if (test_bit (HFSPLUS_SB_HFSX , &sbi->flags)) +HFSPLUS_I (dir)->subfolders =0 ; +if (!inode) goto out;Signature · 1 line
2.39.2