[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250403-inkognito-museen-4a78cc088344@brauner>
Date: Thu, 3 Apr 2025 10:01:29 +0200
From: Christian Brauner <brauner@...nel.org>
To: Xiaole He <hexiaole1994@....com>
Cc: viro@...iv.linux.org.uk, jack@...e.cz, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] fs/super.c: Add NULL check for type in
iterate_supers_type
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@....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.
Powered by blists - more mailing lists