lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240307050717.GB538574@ZenIV>
Date: Thu, 7 Mar 2024 05:07:17 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Baokun Li <libaokun1@...wei.com>
Cc: linux-erofs@...ts.ozlabs.org, xiang@...nel.org, chao@...nel.org,
	huyue2@...lpad.com, jefflexu@...ux.alibaba.com,
	linux-kernel@...r.kernel.org, yangerkun@...wei.com,
	houtao1@...wei.com, yukuai3@...wei.com, chengzhihao1@...wei.com
Subject: Re: [PATCH] erofs: fix lockdep false positives on initializing
 erofs_pseudo_mnt

On Thu, Mar 07, 2024 at 10:44:59AM +0800, Baokun Li wrote:

> +static int erofs_anon_init_fs_context(struct fs_context *fc)
> +{
> +	fc->ops = &erofs_anon_context_ops;
> +	return 0;
> +}


ITYM
        struct pseudo_fs_context *ctx = init_pseudo(fc, EROFS_SUPER_MAGIC);
	return ctx ? 0 : -ENOMEM;

and to hell with erofs_anon_context_ops, along with its fill_super, calls
of simple_fill_super(), etc.  Unless I'm missing something, you are not
even creating dentries here, let alone making them possible to look up.

> +static void erofs_kill_pseudo_sb(struct super_block *sb)
> +{
> +	kill_anon_super(sb);
> +}

*blink*

What's wrong with simply using kill_anon_super as ->kill_sb?

> +int erofs_anon_register_fs(void)
> +{
> +	return register_filesystem(&erofs_anon_fs_type);
> +}

What for?  The only thing it gives you is an ability to look it up by
name.  Which is completely pointless, IMO,

>  	if (!erofs_pseudo_mnt) {
> -		struct vfsmount *mnt = kern_mount(&erofs_fs_type);
> +		struct vfsmount *mnt = kern_mount(&erofs_anon_fs_type);

.. since you are getting to it by direct reference to file_system_type
anyway.  Same unregistering, of course...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ