linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] hfsplus: Initialize directory subfolders in hfsplus_mknod
@ 2024-07-27  6:13 Siddharth Menon
  2024-07-27 14:52 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Siddharth Menon @ 2024-07-27  6:13 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: linux-kernel-mentees, syzbot+fdedff847a0e5e84c39f,
	Siddharth Menon

Addresses uninitialized subfolders attribute being used in 
`hfsplus_subfolders_inc` and `hfsplus_subfolders_dec`.

Fixes: https://syzkaller.appspot.com/bug?extid=fdedff847a0e5e84c39f
Reported-by: syzbot+fdedff847a0e5e84c39f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/x/report.txt?x=16efda06680000
Signed-off-by: Siddharth Menon <simeddon@gmail.com>
---
Removed changes that was accidentally added while debugging
and reformatted the message.

 fs/hfsplus/dir.c | 3 +++
 1 file changed, 3 insertions(+)
644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -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;
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] hfsplus: Initialize directory subfolders in hfsplus_mknod
  2024-07-27  6:13 [PATCH v2] hfsplus: Initialize directory subfolders in hfsplus_mknod Siddharth Menon
@ 2024-07-27 14:52 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2024-07-27 14:52 UTC (permalink / raw)
  To: Siddharth Menon
  Cc: linux-fsdevel, linux-kernel-mentees, syzbot+fdedff847a0e5e84c39f

On Sat, Jul 27, 2024 at 11:43:04AM +0530, Siddharth Menon wrote:
> Addresses uninitialized subfolders attribute being used in 
> `hfsplus_subfolders_inc` and `hfsplus_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?

> Fixes: https://syzkaller.appspot.com/bug?extid=fdedff847a0e5e84c39f
> Reported-by: syzbot+fdedff847a0e5e84c39f@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/x/report.txt?x=16efda06680000
> Signed-off-by: Siddharth Menon <simeddon@gmail.com>
> ---
> Removed changes that was accidentally added while debugging
> and reformatted the message.
> 
>  fs/hfsplus/dir.c | 3 +++
>  1 file changed, 3 insertions(+)
> 644
> --- a/fs/hfsplus/dir.c
> +++ b/fs/hfsplus/dir.c
> @@ -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;
>  
> -- 
> 2.39.2
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-27 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-27  6:13 [PATCH v2] hfsplus: Initialize directory subfolders in hfsplus_mknod Siddharth Menon
2024-07-27 14:52 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).