* linux-next: creds tree build failure
@ 2008-08-08 6:36 Stephen Rothwell
2008-08-08 7:34 ` David Howells
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2008-08-08 6:36 UTC (permalink / raw)
To: David Howells, James Morris; +Cc: linux-next
Hi David,
Today's linux-next build (powerpc ppc64_defconfig) failed like this:
arch/powerpc/platforms/cell/spufs/inode.c: In function 'spufs_context_open':
arch/powerpc/platforms/cell/spufs/inode.c:326: error: too few arguments to function 'dentry_open'
arch/powerpc/platforms/cell/spufs/inode.c: In function 'spufs_gang_open':
arch/powerpc/platforms/cell/spufs/inode.c:563: error: too few arguments to function 'dentry_open'
kernel/cred.c:71: warning: 'struct thread_group_cred' declared inside parameter list
kernel/cred.c:71: warning: its scope is only this definition or declaration, which is probably not what you want
kernel/cred.c: In function 'put_cred_rcu':
kernel/cred.c:93: error: 'struct cred' has no member named 'tgcred'
kernel/cred.c: In function 'copy_creds':
kernel/cred.c:291: error: 'const struct cred' has no member named 'thread_keyring'
kernel/cred.c:286: warning: unused variable 'tgcred'
I applied the following (almost certainly wrong) patch.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
>From e963c9f33fae20e19f5b97bf512c41b07199def4 Mon Sep 17 00:00:00 2001
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 8 Aug 2008 16:26:19 +1000
Subject: [PATCH] creds: build fixes 1
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/cell/spufs/inode.c | 5 +++--
kernel/cred.c | 12 ++++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 60bd5ed..80f4506 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -34,6 +34,7 @@
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/parser.h>
+#include <linux/cred.h>
#include <asm/prom.h>
#include <asm/spu.h>
@@ -323,7 +324,7 @@ static int spufs_context_open(struct dentry *dentry, struct vfsmount *mnt)
goto out;
}
- filp = dentry_open(dentry, mnt, O_RDONLY);
+ filp = dentry_open(dentry, mnt, O_RDONLY, current_cred());
if (IS_ERR(filp)) {
put_unused_fd(ret);
ret = PTR_ERR(filp);
@@ -560,7 +561,7 @@ static int spufs_gang_open(struct dentry *dentry, struct vfsmount *mnt)
goto out;
}
- filp = dentry_open(dentry, mnt, O_RDONLY);
+ filp = dentry_open(dentry, mnt, O_RDONLY, current_cred());
if (IS_ERR(filp)) {
put_unused_fd(ret);
ret = PTR_ERR(filp);
diff --git a/kernel/cred.c b/kernel/cred.c
index 6e9cfbf..f89c5e5 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -65,16 +65,18 @@ static void put_tgcred_rcu(struct rcu_head *rcu)
}
#endif
+#ifdef CONFIG_KEYS
/*
* Release a set of thread group credentials.
*/
void put_tgcred(struct thread_group_cred *tgcred)
{
-#ifdef CONFIG_KEYS
if (atomic_dec_and_test(&tgcred->usage))
call_rcu(&tgcred->rcu, put_tgcred_rcu);
-#endif
}
+#else
+#define put_tgcred(t)
+#endif
/*
* The RCU callback to actually dispose of a set of credentials
@@ -283,12 +285,18 @@ error:
*/
int copy_creds(struct task_struct *p, unsigned long clone_flags)
{
+#ifdef CONFIG_KEYS
struct thread_group_cred *tgcred;
+#endif
struct cred *new;
mutex_init(&p->cred_exec_mutex);
+#ifdef CONFIG_KEYS
if (!p->cred->thread_keyring && clone_flags & CLONE_THREAD) {
+#else
+ if (clone_flags & CLONE_THREAD) {
+#endif
p->real_cred = get_cred(p->cred);
get_cred(p->cred);
return 0;
--
1.5.6.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-08-08 6:36 Stephen Rothwell
@ 2008-08-08 7:34 ` David Howells
2008-08-08 10:58 ` James Morris
0 siblings, 1 reply; 12+ messages in thread
From: David Howells @ 2008-08-08 7:34 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: dhowells, James Morris, linux-next
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> +++ b/arch/powerpc/platforms/cell/spufs/inode.c
> ...
> +#include <linux/cred.h>
Yep.
> - filp = dentry_open(dentry, mnt, O_RDONLY);
> + filp = dentry_open(dentry, mnt, O_RDONLY, current_cred());
Yep.
> - filp = dentry_open(dentry, mnt, O_RDONLY);
> + filp = dentry_open(dentry, mnt, O_RDONLY, current_cred());
Yep.
> +#ifdef CONFIG_KEYS
> /*
> * Release a set of thread group credentials.
> */
> void put_tgcred(struct thread_group_cred *tgcred)
> {
> -#ifdef CONFIG_KEYS
> if (atomic_dec_and_test(&tgcred->usage))
> call_rcu(&tgcred->rcu, put_tgcred_rcu);
> -#endif
> }
> +#else
> +#define put_tgcred(t)
> +#endif
That'll do.
> int copy_creds(struct task_struct *p, unsigned long clone_flags)
> {
> +#ifdef CONFIG_KEYS
> struct thread_group_cred *tgcred;
> +#endif
> struct cred *new;
>
> mutex_init(&p->cred_exec_mutex);
>
> +#ifdef CONFIG_KEYS
> if (!p->cred->thread_keyring && clone_flags & CLONE_THREAD) {
> +#else
> + if (clone_flags & CLONE_THREAD) {
> +#endif
> p->real_cred = get_cred(p->cred);
> get_cred(p->cred);
> return 0;
That should be okay.
Seems I forgot to compile with CONFIG_KEYS=n.
David
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-08-08 7:34 ` David Howells
@ 2008-08-08 10:58 ` James Morris
0 siblings, 0 replies; 12+ messages in thread
From: James Morris @ 2008-08-08 10:58 UTC (permalink / raw)
To: David Howells; +Cc: Stephen Rothwell, linux-next
On Fri, 8 Aug 2008, David Howells wrote:
> That should be okay.
Stephen's patch applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next-creds
- James
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* linux-next: creds tree build failure
@ 2008-10-17 6:25 Stephen Rothwell
2008-10-17 7:36 ` James Morris
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Stephen Rothwell @ 2008-10-17 6:25 UTC (permalink / raw)
To: David Howells, James Morris; +Cc: linux-next, Ian Kent, Andrew Morton
Hi David,
Today's linux-next build (powerpc_ppc64_defconfig) failed like this:
fs/autofs4/dev-ioctl.c: In function 'autofs_dev_ioctl_open_mountpoint':
fs/autofs4/dev-ioctl.c:310: error: too few arguments to function 'dentry_open'
Commit 8d7b48e0bc5fa01a818eac713d4cb0763090cd0e ("autofs4: add
miscellaneous device for ioctls") added this file and interacts with
commit 327a669334991cb9d42e7eddf771fd760721fbf8 ("CRED: Pass credentials
through dentry_open()") from the creds tree.
I applied the following patch (which may not be correct).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 17 Oct 2008 17:23:07 +1100
Subject: [PATCH] creds: autofs4 needs updating for dentry_open change
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
fs/autofs4/dev-ioctl.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index 625abf5..3c299be 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -288,6 +288,7 @@ static int autofs_dev_ioctl_open_mountpoint(const char *path, dev_t devid)
struct file *filp;
struct nameidata nd;
int err, fd;
+ const struct cred *cred = current_cred();
fd = get_unused_fd();
if (likely(fd >= 0)) {
@@ -307,7 +308,8 @@ static int autofs_dev_ioctl_open_mountpoint(const char *path, dev_t devid)
goto out;
}
- filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY);
+ filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
+ cred);
if (IS_ERR(filp)) {
err = PTR_ERR(filp);
goto out;
--
1.5.6.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 6:25 linux-next: creds tree build failure Stephen Rothwell
@ 2008-10-17 7:36 ` James Morris
2008-10-17 7:56 ` Stephen Rothwell
2008-10-17 10:37 ` David Howells
2008-10-17 11:26 ` Ian Kent
2 siblings, 1 reply; 12+ messages in thread
From: James Morris @ 2008-10-17 7:36 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: David Howells, linux-next, Ian Kent, Andrew Morton
On Fri, 17 Oct 2008, Stephen Rothwell wrote:
> Hi David,
>
> Today's linux-next build (powerpc_ppc64_defconfig) failed like this:
>
> fs/autofs4/dev-ioctl.c: In function 'autofs_dev_ioctl_open_mountpoint':
> fs/autofs4/dev-ioctl.c:310: error: too few arguments to function 'dentry_open'
>
> Commit 8d7b48e0bc5fa01a818eac713d4cb0763090cd0e ("autofs4: add
> miscellaneous device for ioctls") added this file and interacts with
> commit 327a669334991cb9d42e7eddf771fd760721fbf8 ("CRED: Pass credentials
> through dentry_open()") from the creds tree.
>
> I applied the following patch (which may not be correct).
When did you fetch my tree? I fixed this earlier today.
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Fri, 17 Oct 2008 17:23:07 +1100
> Subject: [PATCH] creds: autofs4 needs updating for dentry_open change
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> fs/autofs4/dev-ioctl.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
> index 625abf5..3c299be 100644
> --- a/fs/autofs4/dev-ioctl.c
> +++ b/fs/autofs4/dev-ioctl.c
> @@ -288,6 +288,7 @@ static int autofs_dev_ioctl_open_mountpoint(const char *path, dev_t devid)
> struct file *filp;
> struct nameidata nd;
> int err, fd;
> + const struct cred *cred = current_cred();
>
> fd = get_unused_fd();
> if (likely(fd >= 0)) {
> @@ -307,7 +308,8 @@ static int autofs_dev_ioctl_open_mountpoint(const char *path, dev_t devid)
> goto out;
> }
>
> - filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY);
> + filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
> + cred);
> if (IS_ERR(filp)) {
> err = PTR_ERR(filp);
> goto out;
> --
> 1.5.6.5
>
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 7:36 ` James Morris
@ 2008-10-17 7:56 ` Stephen Rothwell
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2008-10-17 7:56 UTC (permalink / raw)
To: James Morris; +Cc: David Howells, linux-next, Ian Kent, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
Hi James,
On Fri, 17 Oct 2008 18:36:58 +1100 (EST) James Morris <jmorris@namei.org> wrote:
>
> When did you fetch my tree? I fixed this earlier today.
I always fetch the tree in the morning my time (to get a mostly
consistent snapshot). Today it was about 9am (+1100).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 6:25 linux-next: creds tree build failure Stephen Rothwell
2008-10-17 7:36 ` James Morris
@ 2008-10-17 10:37 ` David Howells
2008-10-17 10:55 ` Stephen Rothwell
2008-10-17 11:26 ` Ian Kent
2 siblings, 1 reply; 12+ messages in thread
From: David Howells @ 2008-10-17 10:37 UTC (permalink / raw)
To: Stephen Rothwell
Cc: dhowells, James Morris, linux-next, Ian Kent, Andrew Morton
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> + const struct cred *cred = current_cred();
> ...
> - filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY);
> + filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
> + cred);
ACK... Or you could pull the fix from JamesM's tree.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 10:37 ` David Howells
@ 2008-10-17 10:55 ` Stephen Rothwell
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2008-10-17 10:55 UTC (permalink / raw)
To: David Howells; +Cc: James Morris, linux-next, Ian Kent, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
On Fri, 17 Oct 2008 11:37:02 +0100 David Howells <dhowells@redhat.com> wrote:
>
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > + const struct cred *cred = current_cred();
> > ...
> > - filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY);
> > + filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
> > + cred);
>
> ACK... Or you could pull the fix from JamesM's tree.
I'll get that in Monday.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 6:25 linux-next: creds tree build failure Stephen Rothwell
2008-10-17 7:36 ` James Morris
2008-10-17 10:37 ` David Howells
@ 2008-10-17 11:26 ` Ian Kent
2008-10-17 11:34 ` David Howells
2 siblings, 1 reply; 12+ messages in thread
From: Ian Kent @ 2008-10-17 11:26 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: David Howells, James Morris, linux-next, Andrew Morton
On Fri, 17 Oct 2008, Stephen Rothwell wrote:
> Hi David,
>
> Today's linux-next build (powerpc_ppc64_defconfig) failed like this:
>
> fs/autofs4/dev-ioctl.c: In function 'autofs_dev_ioctl_open_mountpoint':
> fs/autofs4/dev-ioctl.c:310: error: too few arguments to function 'dentry_open'
>
> Commit 8d7b48e0bc5fa01a818eac713d4cb0763090cd0e ("autofs4: add
> miscellaneous device for ioctls") added this file and interacts with
> commit 327a669334991cb9d42e7eddf771fd760721fbf8 ("CRED: Pass credentials
> through dentry_open()") from the creds tree.
>
> I applied the following patch (which may not be correct).
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Fri, 17 Oct 2008 17:23:07 +1100
> Subject: [PATCH] creds: autofs4 needs updating for dentry_open change
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> fs/autofs4/dev-ioctl.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
> index 625abf5..3c299be 100644
> --- a/fs/autofs4/dev-ioctl.c
> +++ b/fs/autofs4/dev-ioctl.c
> @@ -288,6 +288,7 @@ static int autofs_dev_ioctl_open_mountpoint(const char *path, dev_t devid)
> struct file *filp;
> struct nameidata nd;
> int err, fd;
> + const struct cred *cred = current_cred();
>
> fd = get_unused_fd();
> if (likely(fd >= 0)) {
> @@ -307,7 +308,8 @@ static int autofs_dev_ioctl_open_mountpoint(const char *path, dev_t devid)
> goto out;
> }
>
> - filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY);
> + filp = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
> + cred);
btw, I believe that in Andrews tree a NULL has been added to dentry_open.
> if (IS_ERR(filp)) {
> err = PTR_ERR(filp);
> goto out;
> --
> 1.5.6.5
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 11:26 ` Ian Kent
@ 2008-10-17 11:34 ` David Howells
2008-10-17 11:38 ` Ian Kent
0 siblings, 1 reply; 12+ messages in thread
From: David Howells @ 2008-10-17 11:34 UTC (permalink / raw)
To: Ian Kent
Cc: dhowells, Stephen Rothwell, James Morris, linux-next,
Andrew Morton
Ian Kent <raven@themaw.net> wrote:
> btw, I believe that in Andrews tree a NULL has been added to dentry_open.
That should really be current_cred(), not NULL, lest SELinux fall over.
David
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 11:34 ` David Howells
@ 2008-10-17 11:38 ` Ian Kent
2008-10-17 16:17 ` David Howells
0 siblings, 1 reply; 12+ messages in thread
From: Ian Kent @ 2008-10-17 11:38 UTC (permalink / raw)
To: David Howells; +Cc: Stephen Rothwell, James Morris, linux-next, Andrew Morton
On Fri, 17 Oct 2008, David Howells wrote:
> Ian Kent <raven@themaw.net> wrote:
>
> > btw, I believe that in Andrews tree a NULL has been added to dentry_open.
>
> That should really be current_cred(), not NULL, lest SELinux fall over.
Right, I've got some updates to send to Andrew.
Would it be best for me to add this in those or would it be best for
someone else here to do it?
Ian
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: creds tree build failure
2008-10-17 11:38 ` Ian Kent
@ 2008-10-17 16:17 ` David Howells
0 siblings, 0 replies; 12+ messages in thread
From: David Howells @ 2008-10-17 16:17 UTC (permalink / raw)
To: Ian Kent
Cc: dhowells, Stephen Rothwell, James Morris, linux-next,
Andrew Morton
Ian Kent <raven@themaw.net> wrote:
> Right, I've got some updates to send to Andrew.
> Would it be best for me to add this in those or would it be best for
> someone else here to do it?
I believe it should be fixed in linux-next, if not now then next time he
redoes it.
David
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-10-17 16:18 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 6:25 linux-next: creds tree build failure Stephen Rothwell
2008-10-17 7:36 ` James Morris
2008-10-17 7:56 ` Stephen Rothwell
2008-10-17 10:37 ` David Howells
2008-10-17 10:55 ` Stephen Rothwell
2008-10-17 11:26 ` Ian Kent
2008-10-17 11:34 ` David Howells
2008-10-17 11:38 ` Ian Kent
2008-10-17 16:17 ` David Howells
-- strict thread matches above, loose matches on Subject: below --
2008-08-08 6:36 Stephen Rothwell
2008-08-08 7:34 ` David Howells
2008-08-08 10:58 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).