From mboxrd@z Thu Jan  1 00:00:00 1970
From: Stephen Rothwell <sfr@canb.auug.org.au>
Subject: linux-next: creds tree build failure
Date: Fri, 8 Aug 2008 16:36:33 +1000
Message-ID: <20080808163633.d9e10b46.sfr@canb.auug.org.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-path: <linux-next-owner@vger.kernel.org>
Received: from chilli.pcug.org.au ([203.10.76.44]:48867 "EHLO smtps.tip.net.au"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1752893AbYHHGgi (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 8 Aug 2008 02:36:38 -0400
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: David Howells <dhowells@redhat.com>, James Morris <jmorris@namei.org>
Cc: linux-next@vger.kernel.org

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

From mboxrd@z Thu Jan  1 00:00:00 1970
From: David Howells <dhowells@redhat.com>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 08 Aug 2008 08:34:39 +0100
Message-ID: <3708.1218180879@redhat.com>
References: <20080808163633.d9e10b46.sfr@canb.auug.org.au>
Return-path: <linux-next-owner@vger.kernel.org>
Received: from mx1.redhat.com ([66.187.233.31]:46997 "EHLO mx1.redhat.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1752073AbYHHHeo (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 8 Aug 2008 03:34:44 -0400
In-Reply-To: <20080808163633.d9e10b46.sfr@canb.auug.org.au>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: dhowells@redhat.com, James Morris <jmorris@namei.org>, linux-next@vger.kernel.org

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

From mboxrd@z Thu Jan  1 00:00:00 1970
From: James Morris <jmorris@namei.org>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 8 Aug 2008 20:58:42 +1000 (EST)
Message-ID: <alpine.LRH.1.10.0808082058001.25784@tundra.namei.org>
References: <20080808163633.d9e10b46.sfr@canb.auug.org.au> <3708.1218180879@redhat.com>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-path: <linux-next-owner@vger.kernel.org>
Received: from tundra.namei.org ([65.99.196.166]:37954 "EHLO tundra.namei.org"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1751019AbYHHK7H (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 8 Aug 2008 06:59:07 -0400
In-Reply-To: <3708.1218180879@redhat.com>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>, linux-next@vger.kernel.org

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>

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Stephen Rothwell <sfr@canb.auug.org.au>
Subject: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 17:25:46 +1100
Message-ID: <20081017172546.ee699528.sfr@canb.auug.org.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-path: <linux-next-owner@vger.kernel.org>
Received: from chilli.pcug.org.au ([203.10.76.44]:32930 "EHLO smtps.tip.net.au"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1753975AbYJQGjz (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 02:39:55 -0400
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: David Howells <dhowells@redhat.com>, James Morris <jmorris@namei.org>
Cc: linux-next@vger.kernel.org, Ian Kent <raven@themaw.net>, Andrew Morton <akpm@linux-foundation.org>

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

From mboxrd@z Thu Jan  1 00:00:00 1970
From: James Morris <jmorris@namei.org>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 18:36:58 +1100 (EST)
Message-ID: <alpine.LRH.1.10.0810171836310.19670@tundra.namei.org>
References: <20081017172546.ee699528.sfr@canb.auug.org.au>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-path: <linux-next-owner@vger.kernel.org>
Received: from tundra.namei.org ([65.99.196.166]:59637 "EHLO tundra.namei.org"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1751605AbYJQHhd (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 03:37:33 -0400
In-Reply-To: <20081017172546.ee699528.sfr@canb.auug.org.au>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: David Howells <dhowells@redhat.com>, linux-next@vger.kernel.org, Ian Kent <raven@themaw.net>, Andrew Morton <akpm@linux-foundation.org>

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>

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 18:56:10 +1100
Message-ID: <20081017185610.327d7219.sfr@canb.auug.org.au>
References: <20081017172546.ee699528.sfr@canb.auug.org.au>
	<alpine.LRH.1.10.0810171836310.19670@tundra.namei.org>
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
 micalg="PGP-SHA1";
 boundary="Signature=_Fri__17_Oct_2008_18_56_10_+1100_9aWPAOuhDsFPOvPl"
Return-path: <linux-next-owner@vger.kernel.org>
Received: from chilli.pcug.org.au ([203.10.76.44]:47773 "EHLO smtps.tip.net.au"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1751501AbYJQH4X (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 03:56:23 -0400
In-Reply-To: <alpine.LRH.1.10.0810171836310.19670@tundra.namei.org>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: James Morris <jmorris@namei.org>
Cc: David Howells <dhowells@redhat.com>, linux-next@vger.kernel.org, Ian Kent <raven@themaw.net>, Andrew Morton <akpm@linux-foundation.org>

--Signature=_Fri__17_Oct_2008_18_56_10_+1100_9aWPAOuhDsFPOvPl
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi James,

On Fri, 17 Oct 2008 18:36:58 +1100 (EST) James Morris <jmorris@namei.org> w=
rote:
>
> 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).

--=20
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

--Signature=_Fri__17_Oct_2008_18_56_10_+1100_9aWPAOuhDsFPOvPl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkj4RRoACgkQjjKRsyhoI8zkfwCgqA5p3HYT4+b7oFe71t16SV4a
v2MAoKT/dw52dksKLY2etkishkSnK1vA
=l3K4
-----END PGP SIGNATURE-----

--Signature=_Fri__17_Oct_2008_18_56_10_+1100_9aWPAOuhDsFPOvPl--

From mboxrd@z Thu Jan  1 00:00:00 1970
From: David Howells <dhowells@redhat.com>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 11:37:02 +0100
Message-ID: <26969.1224239822@redhat.com>
References: <20081017172546.ee699528.sfr@canb.auug.org.au>
Return-path: <linux-next-owner@vger.kernel.org>
Received: from mx2.redhat.com ([66.187.237.31]:37624 "EHLO mx2.redhat.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1752572AbYJQKhn (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 06:37:43 -0400
In-Reply-To: <20081017172546.ee699528.sfr@canb.auug.org.au>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: dhowells@redhat.com, James Morris <jmorris@namei.org>, linux-next@vger.kernel.org, Ian Kent <raven@themaw.net>, Andrew Morton <akpm@linux-foundation.org>

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.

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 21:55:44 +1100
Message-ID: <20081017215544.c6192cdb.sfr@canb.auug.org.au>
References: <20081017172546.ee699528.sfr@canb.auug.org.au>
	<26969.1224239822@redhat.com>
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
 micalg="PGP-SHA1";
 boundary="Signature=_Fri__17_Oct_2008_21_55_44_+1100_DLLxKU9NjilTzfLe"
Return-path: <linux-next-owner@vger.kernel.org>
Received: from chilli.pcug.org.au ([203.10.76.44]:55923 "EHLO smtps.tip.net.au"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1751142AbYJQKzx (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 06:55:53 -0400
In-Reply-To: <26969.1224239822@redhat.com>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>, linux-next@vger.kernel.org, Ian Kent <raven@themaw.net>, Andrew Morton <akpm@linux-foundation.org>

--Signature=_Fri__17_Oct_2008_21_55_44_+1100_DLLxKU9NjilTzfLe
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, 17 Oct 2008 11:37:02 +0100 David Howells <dhowells@redhat.com> wrot=
e:
>
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>=20
> > +	const struct cred *cred =3D current_cred();
> > ...
> > -		filp =3D dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY);
> > +		filp =3D dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
> > +			cred);
>=20
> ACK...  Or you could pull the fix from JamesM's tree.

I'll get that in Monday.

--=20
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

--Signature=_Fri__17_Oct_2008_21_55_44_+1100_DLLxKU9NjilTzfLe
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkj4bzAACgkQjjKRsyhoI8yxbgCeJdMOYGn90iUHIl25Ie9aCBxW
1GUAoJy4ehsqZMMBuQ2JdIT7geQda+pX
=IwO6
-----END PGP SIGNATURE-----

--Signature=_Fri__17_Oct_2008_21_55_44_+1100_DLLxKU9NjilTzfLe--

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Ian Kent <raven@themaw.net>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 19:26:34 +0800 (WST)
Message-ID: <alpine.LFD.2.00.0810171925220.10714@raven.themaw.net>
References: <20081017172546.ee699528.sfr@canb.auug.org.au>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-path: <linux-next-owner@vger.kernel.org>
Received: from out3.smtp.messagingengine.com ([66.111.4.27]:34675 "EHLO
	out3.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK)
	by vger.kernel.org with ESMTP id S1754442AbYJQL0o (ORCPT
	<rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 07:26:44 -0400
In-Reply-To: <20081017172546.ee699528.sfr@canb.auug.org.au>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: David Howells <dhowells@redhat.com>, James Morris <jmorris@namei.org>, linux-next@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>

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
> 
> 

From mboxrd@z Thu Jan  1 00:00:00 1970
From: David Howells <dhowells@redhat.com>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 12:34:47 +0100
Message-ID: <6672.1224243287@redhat.com>
References: <alpine.LFD.2.00.0810171925220.10714@raven.themaw.net> <20081017172546.ee699528.sfr@canb.auug.org.au>
Return-path: <linux-next-owner@vger.kernel.org>
Received: from mx2.redhat.com ([66.187.237.31]:59366 "EHLO mx2.redhat.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1752238AbYJQLe7 (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 07:34:59 -0400
In-Reply-To: <alpine.LFD.2.00.0810171925220.10714@raven.themaw.net>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: Ian Kent <raven@themaw.net>
Cc: dhowells@redhat.com, Stephen Rothwell <sfr@canb.auug.org.au>, James Morris <jmorris@namei.org>, linux-next@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>

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

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Ian Kent <raven@themaw.net>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 19:38:50 +0800 (WST)
Message-ID: <alpine.LFD.2.00.0810171937040.11344@raven.themaw.net>
References: <alpine.LFD.2.00.0810171925220.10714@raven.themaw.net> <20081017172546.ee699528.sfr@canb.auug.org.au> <6672.1224243287@redhat.com>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-path: <linux-next-owner@vger.kernel.org>
Received: from out3.smtp.messagingengine.com ([66.111.4.27]:58959 "EHLO
	out3.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK)
	by vger.kernel.org with ESMTP id S1753174AbYJQLi5 (ORCPT
	<rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 07:38:57 -0400
In-Reply-To: <6672.1224243287@redhat.com>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>, James Morris <jmorris@namei.org>, linux-next@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>

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

From mboxrd@z Thu Jan  1 00:00:00 1970
From: David Howells <dhowells@redhat.com>
Subject: Re: linux-next: creds tree build failure
Date: Fri, 17 Oct 2008 17:17:47 +0100
Message-ID: <1336.1224260267@redhat.com>
References: <alpine.LFD.2.00.0810171937040.11344@raven.themaw.net> <alpine.LFD.2.00.0810171925220.10714@raven.themaw.net> <20081017172546.ee699528.sfr@canb.auug.org.au> <6672.1224243287@redhat.com>
Return-path: <linux-next-owner@vger.kernel.org>
Received: from mx2.redhat.com ([66.187.237.31]:60296 "EHLO mx2.redhat.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1753677AbYJQQSE (ORCPT <rfc822;linux-next@vger.kernel.org>);
	Fri, 17 Oct 2008 12:18:04 -0400
In-Reply-To: <alpine.LFD.2.00.0810171937040.11344@raven.themaw.net>
Sender: linux-next-owner@vger.kernel.org
List-ID: <linux-next.vger.kernel.org>
To: Ian Kent <raven@themaw.net>
Cc: dhowells@redhat.com, Stephen Rothwell <sfr@canb.auug.org.au>, James Morris <jmorris@namei.org>, linux-next@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>

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

