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: <20201109120705.GZ17076@casper.infradead.org>
Date:   Mon, 9 Nov 2020 12:07:05 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Alex Shi <alex.shi@...ux.alibaba.com>
Cc:     linmiaohe@...wei.com, akpm@...ux-foundation.org,
        "Darrick J. Wong" <darrick.wong@...cle.com>,
        Hugh Dickins <hughd@...gle.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [REF PATCH] mm/swap: fix swapon failure

On Mon, Nov 09, 2020 at 07:47:16PM +0800, Alex Shi wrote:
> Go through the context I found the exit_swap_address_space(p->type)
> shouldn't be used in good result path. So just move it to error path.

But ... it's not used in the success path.  There's a 'goto' right
before it.  Does this really fix your problem?

> @@ -3339,7 +3339,8 @@ static bool swap_discardable(struct swap_info_struct *si)
>  	error = inode_drain_writes(inode);
>  	if (error) {
>  		inode->i_flags &= ~S_SWAPFILE;
> -		goto free_swap_address_space;
> +		exit_swap_address_space(p->type);
> +		goto bad_swap_unlock_inode;
>  	}
>  
>  	mutex_lock(&swapon_mutex);
> @@ -3364,8 +3365,6 @@ static bool swap_discardable(struct swap_info_struct *si)
>  
>  	error = 0;
>  	goto out;
> -free_swap_address_space:
> -	exit_swap_address_space(p->type);
>  bad_swap_unlock_inode:
>  	inode_unlock(inode);
>  bad_swap:
> -- 
> 1.8.3.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ