linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baokun Li <libaokun1@huawei.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: "Luís Henriques" <lhenriques@suse.de>,
	"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: Thu, 1 Dec 2022 14:20:09 +0800	[thread overview]
Message-ID: <f898b4d4-f1b2-ffc6-4859-39cc99459cce@huawei.com> (raw)
In-Reply-To: <Y4guSv6wHI1i+3Cz@mit.edu>

On 2022/12/1 12:32, Theodore Ts'o wrote:
> On Wed, Nov 30, 2022 at 11:20:11AM +0800, Baokun Li wrote:
>>> If we can protect against the problem by adding a check that has other
>>> value as well (such as making usre that when ext4_iget fetches a
>>> special inode, we enforce that i_links_couint must be > 0), maybe
>>> that's worth it.
>> Yes, but some special inodes allow i_links_couint to be zero,
>> such as the uninitialized boot load inode.
> That's a good point; but the only time when a special inode can
> validly have a zero i_links_count is when it has no blocks associated
> to it.  Otherwise, when the file system releases the inode using
> iput() when the file system is unmounted, all of the blocks will get
> released when the inode is evicted.  So we can have ext4_iget() allow
> fetching an inode if i_blocks[] is zeros.  But if it has any blocks
> and i_links_count is non-zero, something must be terribly wrong with
> that inode.
>
> Cheers,
>
> 					- Ted
>
Totally agree! That sounds good!

-- 
With Best Regards,
Baokun Li
.

  reply	other threads:[~2022-12-01  6:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 14:20 [PATCH] ext4: fix a NULL pointer when validating an inode bitmap 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
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 [this message]
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=f898b4d4-f1b2-ffc6-4859-39cc99459cce@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;
as well as URLs for NNTP newsgroup(s).