linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Siddharth Menon <simeddon@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	syzbot+fdedff847a0e5e84c39f@syzkaller.appspotmail.com,
	Siddharth Menon <simeddon@gmail.com>
Subject: [PATCH v3] hfsplus: Initialize subfolders value in hfsplus_init_once
Date: Sun, 28 Jul 2024 22:59:13 +0530	[thread overview]
Message-ID: <20240728172910.483823-1-simeddon@gmail.com> (raw)

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`.

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>
---
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)
-- 
2.39.2


                 reply	other threads:[~2024-07-28 17:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240728172910.483823-1-simeddon@gmail.com \
    --to=simeddon@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=syzbot+fdedff847a0e5e84c39f@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).