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: <1506345653.21121.82.camel@surriel.com>
Date:   Mon, 25 Sep 2017 09:20:53 -0400
From:   Rik van Riel <riel@...riel.com>
To:     Gargi Sharma <gs051095@...il.com>, linux-kernel@...r.kernel.org
Cc:     julia.lawall@...6.fr, akpm@...ux-foundation.org, mingo@...nel.org,
        pasha.tatashin@...cle.com, ktkhai@...tuozzo.com, oleg@...hat.com
Subject: Re: [PATCH 3/4] pid.c: Replace pidhash lookup with idr_get()

On Mon, 2017-09-25 at 08:56 -0400, Gargi Sharma wrote:
> pidhash is no longer required as all the functionalities
> are present in the idr tree associated with the namespace.
> nr can be looked up in the namespace by idr_get().
> 
> Signed-off-by: Gargi Sharma <gs051095@...il.com>
> ---
>  kernel/pid.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/kernel/pid.c b/kernel/pid.c
> index ea22e89..761a0c2 100644
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -247,15 +247,7 @@ void disable_pid_allocation(struct pid_namespace
> *ns)
>  
>  struct pid *find_pid_ns(int nr, struct pid_namespace *ns)
>  {
> -	struct upid *pnr;
> -
> -	hlist_for_each_entry_rcu(pnr,
> -			&pid_hash[pid_hashfn(nr, ns)], pid_chain)
> -		if (pnr->nr == nr && pnr->ns == ns)
> -			return container_of(pnr, struct pid,
> -					numbers[ns->level]);
> -
> -	return NULL;
> +	return idr_get(&ns->idr, &nr);
>  }
>  EXPORT_SYMBOL_GPL(find_pid_ns);

Does this work if you call idr_find instead of idr_get?

Then patch 2/4 would not be needed.

-- 
All Rights Reversed.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ