From: Andrew Price <anprice@redhat.com>
To: agruenba@redhat.com
Cc: gfs2@lists.linux.dev,
syzbot+b12826218502df019f9d@syzkaller.appspotmail.com
Subject: [PATCH] gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add()
Date: Wed, 28 May 2025 16:02:37 +0100 [thread overview]
Message-ID: <20250528150237.171254-1-anprice@redhat.com> (raw)
When gfs2_sys_fs_add() fails it sets sb->s_fs_info to NULL which results
in a NULL pointer deref in gfs2_drop_inode() when iput(sdp->sd_inode) is
called in the gfs2_fill_super() error path. Remove the NULL assignment
from gfs2_sys_fs_add() and let gfs2_fill_super() deal with it instead,
after the iput().
Fixes: ae9f3bd8259a ("gfs2: replace sd_aspace with sd_inode")
Reported-by: syzbot+b12826218502df019f9d@syzkaller.appspotmail.com
Signed-off-by: Andrew Price <anprice@redhat.com>
---
fs/gfs2/sys.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 748125653d6c..c3c8842920d2 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -764,7 +764,6 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
fs_err(sdp, "error %d adding sysfs files\n", error);
kobject_put(&sdp->sd_kobj);
wait_for_completion(&sdp->sd_kobj_unregister);
- sb->s_fs_info = NULL;
return error;
}
--
2.49.0
next reply other threads:[~2025-05-28 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 15:02 Andrew Price [this message]
2025-05-29 9:33 ` [PATCH] gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add() Andreas Gruenbacher
2025-05-29 9:59 ` Andrew Price
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=20250528150237.171254-1-anprice@redhat.com \
--to=anprice@redhat.com \
--cc=agruenba@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=syzbot+b12826218502df019f9d@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