linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "jack@suse.cz" <jack@suse.cz>,
	"glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
	"slava@dubeyko.com" <slava@dubeyko.com>,
	"frank.li@vivo.com" <frank.li@vivo.com>,
	"mehdi.benhadjkhelifa@gmail.com" <mehdi.benhadjkhelifa@gmail.com>,
	"brauner@kernel.org" <brauner@kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>
Cc: "linux-kernel-mentees@lists.linuxfoundation.org"
	<linux-kernel-mentees@lists.linuxfoundation.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"david.hunter.linux@gmail.com" <david.hunter.linux@gmail.com>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"khalid@kernel.org" <khalid@kernel.org>,
	"syzbot+ad45f827c88778ff7df6@syzkaller.appspotmail.com"
	<syzbot+ad45f827c88778ff7df6@syzkaller.appspotmail.com>
Subject: RE: [PATCH v2] fs/hfs: fix s_fs_info leak on setup_bdev_super() failure
Date: Fri, 21 Nov 2025 23:01:30 +0000	[thread overview]
Message-ID: <218c654fc2cad8f6acac1530d431094abb1bffbe.camel@ibm.com> (raw)
In-Reply-To: <28fbe625-eb1b-4c7f-925c-aec4685a6cbf@gmail.com>

On Sat, 2025-11-22 at 00:36 +0100, Mehdi Ben Hadj Khelifa wrote:
> On 11/21/25 11:28 PM, Viacheslav Dubeyko wrote:
> > On Sat, 2025-11-22 at 00:16 +0100, Mehdi Ben Hadj Khelifa wrote:
> > > On 11/21/25 11:04 PM, Viacheslav Dubeyko wrote:
> > > > On Fri, 2025-11-21 at 23:48 +0100, Mehdi Ben Hadj Khelifa wrote:
> > > > > On 11/21/25 10:15 PM, Viacheslav Dubeyko wrote:
> > > > > > On Fri, 2025-11-21 at 20:44 +0100, Mehdi Ben Hadj Khelifa wrote:
> > > > > > > On 11/19/25 8:58 PM, Viacheslav Dubeyko wrote:
> > > > > > > > On Wed, 2025-11-19 at 08:38 +0100, Mehdi Ben Hadj Khelifa wrote:
> > > > > > > > > 

<skipped>

> > > > > > 
> > > > > IIUC, hfs_mdb_put() isn't called in the case of hfs_kill_super() in
> > > > > christian's patch because fill_super() (for the each specific
> > > > > filesystem) is responsible for cleaning up the superblock in case of
> > > > > failure and you can reference christian's patch[1] which he explained
> > > > > the reasoning for here[2].And in the error path the we are trying to
> > > > > fix, fill_super() isn't even called yet. So such pointers shouldn't be
> > > > > pointing to anything allocated yet hence only freeing the pointer to the
> > > > > sb_info here is sufficient I think.
> > 
> > I was confused that your code with hfs_mdb_put() is still in this email. So,
> > yes, hfs_fill_super()/hfsplus_fill_super() try to free the memory in the case of
> > failure. It means that if something wasn't been freed, then it will be issue in
> > these methods. Then, I don't see what should else need to be added here. Some
> > file systems do sb->s_fs_info = NULL. But absence of this statement is not
> > critical, from my point of view.
> > 
> Thanks for the input. I will be sending the same mentionned patch after 
> doing testing for it and also after finishing my testing for the hfs 
> patch too.
> > 

I am guessing... Should we consider to introduce some xfstest, self-test, or
unit-test to detect this issue in all Linux's file systems family?

Thanks,
Slava.

  reply	other threads:[~2025-11-21 23:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19  7:38 [PATCH v2] fs/hfs: fix s_fs_info leak on setup_bdev_super() failure Mehdi Ben Hadj Khelifa
2025-11-19 14:14 ` Christian Brauner
2025-11-19 15:27   ` Mehdi Ben Hadj Khelifa
2025-11-19 19:58 ` Viacheslav Dubeyko
2025-11-19 22:21   ` Mehdi Ben Hadj Khelifa
2025-11-19 22:24     ` Mehdi Ben Hadj Khelifa
2025-11-21 19:44   ` Mehdi Ben Hadj Khelifa
2025-11-21 21:15     ` Viacheslav Dubeyko
2025-11-21 22:48       ` Mehdi Ben Hadj Khelifa
2025-11-21 22:04         ` Viacheslav Dubeyko
2025-11-21 23:16           ` Mehdi Ben Hadj Khelifa
2025-11-21 22:28             ` Viacheslav Dubeyko
2025-11-21 23:36               ` Mehdi Ben Hadj Khelifa
2025-11-21 23:01                 ` Viacheslav Dubeyko [this message]
2025-11-25 22:14                   ` Mehdi Ben Hadj Khelifa
2025-11-25 22:36                     ` Viacheslav Dubeyko
2025-11-27 17:45                     ` David Hunter
2025-11-29 13:06                       ` Mehdi Ben Hadj Khelifa
2025-11-26 13:48   ` Christian Brauner
2025-11-26 16:06     ` Mehdi Ben Hadj Khelifa
2025-11-26 22:30       ` Viacheslav Dubeyko
2025-11-27  8:59         ` Christian Brauner
2025-11-27 20:19           ` Viacheslav Dubeyko
2025-11-29 12:48             ` Mehdi Ben Hadj Khelifa
2025-12-01 19:24               ` Viacheslav Dubeyko
2025-12-01 21:19                 ` Mehdi Ben Hadj Khelifa
2025-12-01 20:37                   ` Viacheslav Dubeyko
2025-12-01 21:57                     ` Mehdi Ben Hadj Khelifa

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=218c654fc2cad8f6acac1530d431094abb1bffbe.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=brauner@kernel.org \
    --cc=david.hunter.linux@gmail.com \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=jack@suse.cz \
    --cc=khalid@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mehdi.benhadjkhelifa@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=slava@dubeyko.com \
    --cc=syzbot+ad45f827c88778ff7df6@syzkaller.appspotmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).