public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSv4: rpc_mkpipe creating socket inodes w/out sk buffers.
@ 2006-09-06 15:51 Steve Dickson
  0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2006-09-06 15:51 UTC (permalink / raw)
  To: nfsv4; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

rpc_mkpipe sets the S_IFSOCK mode bit when it creates a
inode but does not create a true socket inode. So when other parts
of the kernel (i.e. the SELinux code in the-mm kernel) use
S_ISSOCK() to see if the inode is a socket, the macro returns true,
but the expected socket inode container structure is really
an rpc_inode container which obviously causes problems...

This patch simply change the S_IFSOCK mode bit to
S_IFIFO which eliminates the problem.

steved.

[-- Attachment #2: nfs-2.6-rpc-mkpipe.patch --]
[-- Type: text/x-patch, Size: 858 bytes --]

This patch stop rpc_mkpipe from create S_IFSOCK nodes what don't 
have associated sk buffers attached (which causes SELinux to oops
during NFSv4 mounts). Instead the S_IFIFO mode bit is set which
probably make more sense and seems to work just fine during
my connectathon and fsx testing... 

Signed-off-by: Steve Dickson <steved@redhat.com>
--------------------------------------

--- nfs-2.6/net/sunrpc/rpc_pipe.c.orig	2006-08-24 14:33:43.000000000 -0400
+++ nfs-2.6/net/sunrpc/rpc_pipe.c	2006-09-06 10:31:45.000000000 -0400
@@ -720,7 +720,7 @@ rpc_mkpipe(struct dentry *parent, const 
 	if (IS_ERR(dentry))
 		return dentry;
 	dir = parent->d_inode;
-	inode = rpc_get_inode(dir->i_sb, S_IFSOCK | S_IRUSR | S_IWUSR);
+	inode = rpc_get_inode(dir->i_sb, S_IFIFO | S_IRUSR | S_IWUSR);
 	if (!inode)
 		goto err_dput;
 	inode->i_ino = iunique(dir->i_sb, 100);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-06 15:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-06 15:51 [PATCH] NFSv4: rpc_mkpipe creating socket inodes w/out sk buffers Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox