* linux-next: build failure after merge of the userns tree
@ 2012-05-21 7:50 Stephen Rothwell
2012-05-21 22:05 ` Eric W. Biederman
2012-05-23 15:34 ` [tip:sched/numa] sched/numa, userns: Fix user_ns move to ' struct cred' tip-bot for Stephen Rothwell
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Rothwell @ 2012-05-21 7:50 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-next, linux-kernel, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, Peter Zijlstra
[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]
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):
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 21 May 2012 17:40:55 +1000
Subject: [PATCH] userns: fix up for user_ns move to struct cred
Signed-off-by: Stephen Rothwell <sfr@canb.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
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux-next: build failure after merge of the userns tree
2012-05-21 7:50 linux-next: build failure after merge of the userns tree Stephen Rothwell
@ 2012-05-21 22:05 ` Eric W. Biederman
2012-05-23 15:34 ` [tip:sched/numa] sched/numa, userns: Fix user_ns move to ' struct cred' tip-bot for Stephen Rothwell
1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2012-05-21 22:05 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-next, linux-kernel, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, Peter Zijlstra
Stephen Rothwell <sfr@canb.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@canb.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@xmission.com>
> Signed-off-by: Stephen Rothwell <sfr@canb.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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:sched/numa] sched/numa, userns: Fix user_ns move to ' struct cred'
2012-05-21 7:50 linux-next: build failure after merge of the userns tree Stephen Rothwell
2012-05-21 22:05 ` Eric W. Biederman
@ 2012-05-23 15:34 ` tip-bot for Stephen Rothwell
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Stephen Rothwell @ 2012-05-23 15:34 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, sfr, tglx, ebiederm
Commit-ID: b51b94a599239de4e3cf769e257a7e87928f20be
Gitweb: http://git.kernel.org/tip/b51b94a599239de4e3cf769e257a7e87928f20be
Author: Stephen Rothwell <sfr@canb.auug.org.au>
AuthorDate: Mon, 21 May 2012 17:50:09 +1000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 23 May 2012 16:30:55 +0200
sched/numa, userns: Fix user_ns move to 'struct cred'
Eliminate obsolete (and to be removed) cred->user-> use.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Link: http://lkml.kernel.org/r/20120521175009.7bd4948c026d8acc61f26753@canb.auug.org.au
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/numa.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/numa.c b/kernel/sched/numa.c
index fdf737d..de66256 100644
--- a/kernel/sched/numa.c
+++ b/kernel/sched/numa.c
@@ -1268,7 +1268,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 &&
@@ -1276,7 +1276,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;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-23 15:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21 7:50 linux-next: build failure after merge of the userns tree Stephen Rothwell
2012-05-21 22:05 ` Eric W. Biederman
2012-05-23 15:34 ` [tip:sched/numa] sched/numa, userns: Fix user_ns move to ' struct cred' tip-bot for Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome