mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: linux-kernel@vger.kernel.org, Neil Brown <neilb@cse.unsw.edu.au>,
	Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Olaf Kirch <okir@suse.de>,
	"Andries E. Brouwer" <Andries.Brouwer@cwi.nl>,
	Andrew Morton <akpm@osdl.org>
Subject: [patch 09/16] Add noacl nfs mount option
Date: Sun, 27 Feb 2005 16:22:52 +0100	[thread overview]
Message-ID: <20050227152352.827516000@blunzn.suse.de> (raw)
In-Reply-To: <20050227152243.083308000@blunzn.suse.de>

[-- Attachment #1: nfsacl-add-noacl-nfs-mount-option.patch --]
[-- Type: text/plain, Size: 2497 bytes --]

With the noacl mount option, nfs clients stop using the ACCESS RPC which they
usually use to get an access decision from the server.  Instead, they make the
decision based on the file ownership and file mode permission bits.

Security-wise using this option can lead to illicit read access to data cached
locally on the client if the server uses POSIX ACLs.  Local access decisions
are correct as long as the server does not support POSIX access control lists.

This approach was discussed with Trond Myklebust <trond.myklebust@fys.uio.no>
and Olaf Kirch <okir@suse.de>.  Requires a patch to mount (util-linux).

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Olaf Kirch <okir@suse.de>

Index: linux-2.6.11-rc5/fs/nfs/dir.c
===================================================================
--- linux-2.6.11-rc5.orig/fs/nfs/dir.c
+++ linux-2.6.11-rc5/fs/nfs/dir.c
@@ -1554,6 +1554,7 @@ out:
 
 int nfs_permission(struct inode *inode, int mask, struct nameidata *nd)
 {
+	struct nfs_server *server = NFS_SERVER(inode);
 	struct rpc_cred *cred;
 	int mode = inode->i_mode;
 	int res;
@@ -1590,7 +1591,7 @@ int nfs_permission(struct inode *inode, 
 
 	lock_kernel();
 
-	if (!NFS_PROTO(inode)->access)
+	if ((server->flags & NFS_MOUNT_NOACL) || !NFS_PROTO(inode)->access)
 		goto out_notsup;
 
 	cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0);
Index: linux-2.6.11-rc5/fs/nfs/inode.c
===================================================================
--- linux-2.6.11-rc5.orig/fs/nfs/inode.c
+++ linux-2.6.11-rc5/fs/nfs/inode.c
@@ -524,6 +524,7 @@ static int nfs_show_options(struct seq_f
 		{ NFS_MOUNT_NOAC, ",noac", "" },
 		{ NFS_MOUNT_NONLM, ",nolock", ",lock" },
 		{ NFS_MOUNT_BROKEN_SUID, ",broken_suid", "" },
+		{ NFS_MOUNT_NOACL, ",noacl", "" },
 		{ 0, NULL, NULL }
 	};
 	struct proc_nfs_info *nfs_infop;
Index: linux-2.6.11-rc5/include/linux/nfs_mount.h
===================================================================
--- linux-2.6.11-rc5.orig/include/linux/nfs_mount.h
+++ linux-2.6.11-rc5/include/linux/nfs_mount.h
@@ -58,6 +58,7 @@ struct nfs_mount_data {
 #define NFS_MOUNT_KERBEROS	0x0100	/* 3 */
 #define NFS_MOUNT_NONLM		0x0200	/* 3 */
 #define NFS_MOUNT_BROKEN_SUID	0x0400	/* 4 */
+#define NFS_MOUNT_NOACL		0x0800  /* 4 */
 #define NFS_MOUNT_STRICTLOCK	0x1000	/* reserved for NFSv4 */
 #define NFS_MOUNT_SECFLAVOUR	0x2000	/* 5 */
 #define NFS_MOUNT_FLAGMASK	0xFFFF

--
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX PRODUCTS GMBH


  parent reply	other threads:[~2005-02-27 16:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-27 15:22 [patch 00/16] NFSACL protocol extension for NFSv3 Andreas Gruenbacher
2005-02-27 15:22 ` [patch 01/16] acl kconfig cleanup Andreas Gruenbacher
2005-02-27 15:22 ` [patch 02/16] Qsort Andreas Gruenbacher
2005-02-27 15:22 ` [patch 03/16] Return -ENOSYS for RPC programs that are unavailable Andreas Gruenbacher
2005-02-27 15:22 ` [patch 04/16] Add missing -EOPNOTSUPP => NFS3ERR_NOTSUPP mapping in nfsd Andreas Gruenbacher
2005-02-27 15:22 ` [patch 05/16] Allow multiple programs to listen on the same port Andreas Gruenbacher
2005-02-27 15:22 ` [patch 06/16] Allow multiple programs to share the same transport Andreas Gruenbacher
2005-02-27 15:22 ` [patch 07/16] Lazy RPC receive buffer allocation Andreas Gruenbacher
2005-02-27 15:22 ` [patch 08/16] Encode and decode arbitrary XDR arrays Andreas Gruenbacher
2005-02-27 15:22 ` Andreas Gruenbacher [this message]
2005-02-27 15:22 ` [patch 10/16] Infrastructure and server side of nfsacl Andreas Gruenbacher
2005-02-27 22:53   ` Christoph Hellwig
2005-02-27 15:22 ` [patch 11/16] Solaris nfsacl workaround Andreas Gruenbacher
2005-03-09 23:56   ` Trond Myklebust
2005-03-10  8:16     ` Andreas Gruenbacher
2005-02-27 15:22 ` [patch 12/16] nfs mknod cleanup Andreas Gruenbacher
2005-02-27 15:22 ` [patch 13/16] nfs mkdir cleanup Andreas Gruenbacher
2005-02-27 15:22 ` [patch 14/16] Client side of nfsacl Andreas Gruenbacher
2005-02-27 15:22 ` [patch 15/16] ACL umask handling workaround in nfs client Andreas Gruenbacher
2005-02-27 15:22 ` [patch 16/16] Cache acls on the nfs client side Andreas Gruenbacher
2005-02-27 16:35 ` [patch 00/16] NFSACL protocol extension for NFSv3 Andreas Gruenbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050227152352.827516000@blunzn.suse.de \
    --to=agruen@suse.de \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=okir@suse.de \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®