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]
Date:   Tue, 31 May 2022 00:24:39 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Daniil Lunev <dlunev@...omium.org>
Cc:     linux-fsdevel@...r.kernel.org, miklos@...redi.hu,
        viro@...iv.linux.org.uk, hch@...radead.org, tytso@....edu,
        fuse-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] fs/super: function to prevent super re-use

On Mon, May 30, 2022 at 11:39:57AM +1000, Daniil Lunev wrote:
> +void retire_super(struct super_block *sb)
> +{
> +	down_write(&sb->s_umount);
> +	if (sb->s_bdi != &noop_backing_dev_info) {
> +		if (sb->s_iflags & SB_I_PERSB_BDI && !(sb->s_iflags & SB_I_RETIRED))

SB_I_PERSB_BDI can't be set for noop_backing_dev_info, so that check
should not be needed.  Which also conveniently fixes the overly long
line.

Also this should clear SB_I_PERSB_BDI as the only place that checks
it is the unregistration.

>  	spin_lock(&sb_lock);
> -	/* should be initialized for __put_super_and_need_restart() */

This is a completely unrelated change.  While the function is gone
it might be worth to check what it got renamed to or folded in, or
if the initialization is still needed.  But all that is for a separate
patch.

>  	up_write(&sb->s_umount);
>  	if (sb->s_bdi != &noop_backing_dev_info) {
> -		if (sb->s_iflags & SB_I_PERSB_BDI)
> +		/* retire should have already unregistered bdi */
> +		if (sb->s_iflags & SB_I_PERSB_BDI && !(sb->s_iflags & SB_I_RETIRED))
>  			bdi_unregister(sb->s_bdi);
>  		bdi_put(sb->s_bdi);

And once SB_I_PERSB_BDI is dropped when retiring we don't need this
change.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ