From: Baokun Li <libaokun1@huawei.com>
To: "Theodore Ts'o" <tytso@mit.edu>, "Luís Henriques" <lhenriques@suse.de>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
<linux-ext4@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH v2] ext4: fix a NULL pointer when validating an inode bitmap
Date: Tue, 29 Nov 2022 11:18:34 +0800 [thread overview]
Message-ID: <d357e15b-e44a-1e3b-41c3-0b732e4685ed@huawei.com> (raw)
In-Reply-To: <Y4U18wly7K87fX9v@mit.edu>
On 2022/11/29 6:28, Theodore Ts'o wrote:
> On Tue, Nov 08, 2022 at 02:06:29PM +0000, Luís Henriques wrote:
>>> What makes you believe that? Look at how s_group_info is initialized
>>> in ext4_mb_alloc_groupinfo() in fs/ext4/mballoc.c. It's pretty
>>> careful to make sure this is not the case.
>> Right. I may be missing something, but I don't think we get that far.
>> __ext4_fill_super() will first call ext4_setup_system_zone() (which is
>> where this bug occurs) and only after that ext4_mb_init() will be invoked
>> (which is where ext4_mb_alloc_groupinfo() will eventually be called).
> I finally got around to taking a closer look at this, and I have a
> much better understandign of what is going on. For more details, and
> a suggested fix, please see:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=216541#c1
>
> - Ted
>
>
Hi Theodore,
In my opinion, the s_journal_inum should not be modified when the file
system is
mounted, especially after we have successfully loaded and replayed the
journal with
the current s_journal_inum. Even if the s_journal_inumon the disk is
modified, we should
use the current one. This is how journal_devnum is handled in
ext4_load_journal():
if (!really_read_only && journal_devnum &&
journal_devnum != le32_to_cpu(es->s_journal_dev)) {
es->s_journal_dev = cpu_to_le32(journal_devnum);
/* Make sure we flush the recovery flag to disk. */
ext4_commit_super(sb);
}
We can avoid this problem by adding a similar check for journal_inum in
ext4_load_journal().
--
With Best Regards,
Baokun Li
next prev parent reply other threads:[~2022-11-29 3:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 14:20 [PATCH] " Luís Henriques
2022-10-11 15:56 ` [PATCH v2] " Luís Henriques
2022-11-06 0:32 ` Theodore Ts'o
2022-11-08 14:06 ` Luís Henriques
2022-11-28 22:28 ` Theodore Ts'o
2022-11-29 3:18 ` Baokun Li [this message]
2022-11-29 21:00 ` Theodore Ts'o
2022-11-30 3:20 ` Baokun Li
2022-12-01 4:32 ` Theodore Ts'o
2022-12-01 6:20 ` Baokun Li
2022-10-12 13:13 ` [PATCH v2] ext4: fix BUG_ON() when directory entry has invalid rec_len Luís Henriques
2022-10-12 13:16 ` Luís Henriques
2022-10-12 14:21 ` Theodore Ts'o
2022-10-12 15:18 ` Luís Henriques
2022-11-06 6:16 ` Theodore Ts'o
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=d357e15b-e44a-1e3b-41c3-0b732e4685ed@huawei.com \
--to=libaokun1@huawei.com \
--cc=adilger.kernel@dilger.ca \
--cc=lhenriques@suse.de \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®