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: <1520389011.23626.24.camel@codethink.co.uk>
Date:   Wed, 07 Mar 2018 02:16:51 +0000
From:   Ben Hutchings <ben.hutchings@...ethink.co.uk>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     stable@...r.kernel.org,
        Sasha Levin <alexander.levin@...rosoft.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4.4 06/34] sget(): handle failures of register_shrinker()

On Fri, 2018-03-02 at 09:51 +0100, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Al Viro <viro@...iv.linux.org.uk>
> 
> 
> [ Upstream commit 9ee332d99e4d5a97548943b81c54668450ce641b ]
> 
> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
> Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
>  fs/super.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -497,7 +497,11 @@ retry:
>  	hlist_add_head(&s->s_instances, &type->fs_supers);
>  	spin_unlock(&sb_lock);
>  	get_filesystem(type);
> -	register_shrinker(&s->s_shrink);
> +	err = register_shrinker(&s->s_shrink);
> +	if (err) {
> +		deactivate_locked_super(s);

But deactivate_locked_super() will call unregister_shrinker(), which
doesn't look safe if register_shrinker() failed.

Ben.

> +		s = ERR_PTR(err);
> +	}
>  	return s;
>  }
>  
> 
> 
> 
-- 
Ben Hutchings
Software Developer, Codethink Ltd.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ