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:	Mon, 21 May 2012 16:05:16 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Stephen Rothwell <sfr@...b.auug.org.au>
Cc:	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: linux-next: build failure after merge of the userns tree

Stephen Rothwell <sfr@...b.auug.org.au> writes:

> Hi Eric,
>
> After merging the userns tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> kernel/sched/numa.c: In function 'ng_allowed':
> kernel/sched/numa.c:1270:16: error: 'struct user_struct' has no member named 'user_ns'
> kernel/sched/numa.c:1270:40: error: 'struct user_struct' has no member named 'user_ns'
> kernel/sched/numa.c:1278:28: error: 'struct user_struct' has no member named 'user_ns'
>
> Caused by commit a2dae61eb839 ("sched/numa: Introduce sys_numa_{t,m}bind
> ()") from the tip tree interacting with commit d0bd6594e286 ("userns:
> Deprecate and rename the user_namespace reference in the user_struct")
> from the userns tree.
>
> I applied this merge fix up patch (more may be required):

The fix is right.

Peter Zijlstra, or Ingo any chance you could add the patch below to your
tree?

It is just a better idiom to access the user namespace pointer as
cred->user_ns, instead of cred->user->user_ns and has been for a few
kernel releases.

Once my usernamespace tree is merged into Linus's tree a little more
will be needed to build this code with user namespaces enabled, but
cred->user->user to cred->user_ns is an improvement whichever way
you look at it.

Otherwise I guess this merge failure will act as a reminder that this
code needs a few more changes.

> From: Stephen Rothwell <sfr@...b.auug.org.au>
> Date: Mon, 21 May 2012 17:40:55 +1000
> Subject: [PATCH] userns: fix up for user_ns move to struct cred
>
Reviewed-by: "Eric W. Biederman" <ebiederm@...ssion.com>
> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
> ---
>  kernel/sched/numa.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/numa.c b/kernel/sched/numa.c
> index 8eb92f7..1149993 100644
> --- a/kernel/sched/numa.c
> +++ b/kernel/sched/numa.c
> @@ -1267,7 +1267,7 @@ static int ng_allowed(struct numa_group *ng, struct task_struct *p)
>  
>  	rcu_read_lock();
>  	tcred = __task_cred(p);
> -	if (cred->user->user_ns == tcred->user->user_ns &&
> +	if (cred->user_ns == tcred->user_ns &&
>  	    (cred->uid == tcred->euid &&
>  	     cred->uid == tcred->suid &&
>  	     cred->uid == tcred->uid  &&
> @@ -1275,7 +1275,7 @@ static int ng_allowed(struct numa_group *ng, struct task_struct *p)
>  	     cred->gid == tcred->sgid &&
>  	     cred->gid == tcred->gid))
>  		goto ok;
> -	if (ns_capable(tcred->user->user_ns, CAP_SYS_PTRACE))
> +	if (ns_capable(tcred->user_ns, CAP_SYS_PTRACE))
>  		goto ok;
>  	rcu_read_unlock();
>  	return -EPERM;
> -- 
> 1.7.10.280.gaa39
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ