From: Christian Brauner <brauner@kernel.org>
To: Xiaole He <hexiaole1994@126.com>
Cc: viro@zeniv.linux.org.uk, jack@suse.cz,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] fs/super.c: Add NULL check for type in iterate_supers_type
Date: Thu, 3 Apr 2025 10:01:29 +0200 [thread overview]
Message-ID: <20250403-inkognito-museen-4a78cc088344@brauner> (raw)
In-Reply-To: <20250402034529.12642-1-hexiaole1994@126.com>
On Wed, Apr 02, 2025 at 11:45:29AM +0800, Xiaole He wrote:
> The first several lines of iterate_supers_type are below:
>
> 1 void iterate_supers_type(struct file_system_type *type,
> 2 void (*f)(struct super_block *, void *), void *arg)
> 3 {
> 4 struct super_block *sb, *p = NULL;
> 5
> 6 spin_lock(&sb_lock);
> 7 hlist_for_each_entry(sb, &type->fs_supers, s_instances) {
> 8 ...
> 9 }
>
> The iterate_super_type is a exported symbol, and if iterate_supers_type
> is called with type of NULL, then there will be a NULL pointer
> dereference of argument type in line 7.
>
> This patch fix above problem by adding NULL pointer check for argument
> type.
>
> Signed-off-by: Xiaole He <hexiaole1994@126.com>
> ---
Both Al and James already pointed out that this check is unnecessary and
ultimately misleading. So we're not going to accept this patch.
prev parent reply other threads:[~2025-04-03 8:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 3:45 Xiaole He
2025-04-02 11:38 ` James Bottomley
[not found] ` <4ee2fdcb.1854a.195f9828c86.Coremail.hexiaole1994@126.com>
2025-04-03 2:47 ` Al Viro
[not found] ` <75a45193.18746.195f9a088c4.Coremail.hexiaole1994@126.com>
2025-04-03 3:50 ` Al Viro
2025-04-03 8:01 ` Christian Brauner [this message]
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=20250403-inkognito-museen-4a78cc088344@brauner \
--to=brauner@kernel.org \
--cc=hexiaole1994@126.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®