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] [day] [month] [year] [list]
Date:   Thu, 20 Dec 2018 17:20:48 +0100
From:   Oleg Nesterov <oleg@...hat.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     "Eric W. Biederman" <ebiederm@...ssion.com>,
        Gargi Sharma <gs051095@...il.com>,
        Rik van Riel <riel@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC] Fix failure path in alloc_pid()

On 12/18, Matthew Wilcox wrote:
>
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -233,8 +233,11 @@ struct pid *alloc_pid(struct pid_namespace *ns)
>  
>  out_free:
>  	spin_lock_irq(&pidmap_lock);
> -	while (++i <= ns->level)
> -		idr_remove(&ns->idr, (pid->numbers + i)->nr);
> +	upid = pid->numbers + i;
> +	while (++i <= ns->level) {
> +		upid++;
> +		idr_remove(&upid->ns->idr, upid->nr);

can't resist...

	while (++i <= ns->level) {
		upid = pid->numbers + i;
		idr_remove(&upid->ns->idr, upid->nr);
	}

looks a bit more clean to me, but this is cosmetic and subjective.

Reviewed-by: Oleg Nesterov <oleg@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ