From: David Howells Subject: [PATCH 21/30] NFS: Secure the roots of the NFS subtrees in a shared superblock [try #11] Date: Thu, 27 Jul 2006 21:53:14 +0100 Message-ID: <20060727205314.8443.77944.stgit@warthog.cambridge.redhat.com> References: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com> Reply-To: Linux filesystem caching discussion list Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: quoted-printable Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org Return-path: To: torvalds@osdl.org, akpm@osdl.org, steved@redhat.com, trond.myklebust@fys.uio.no In-Reply-To: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cachefs-bounces@redhat.com Errors-To: linux-cachefs-bounces@redhat.com List-Id: linux-fsdevel.vger.kernel.org Invoke security_d_instantiate() on root dentries after allocating them wi= th dentry_alloc_anon(). Normally dentry_alloc_root() would do that, but we = don't call that as we don't want to assign a name to the root dentry at this po= int (we may discover the real name later). Signed-Off-By: David Howells --- fs/nfs/getroot.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index 977e590..76b08ae 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c @@ -33,6 +33,7 @@ #include #include #include #include +#include =20 #include #include @@ -109,6 +110,8 @@ struct dentry *nfs_get_root(struct super return ERR_PTR(-ENOMEM); } =20 + security_d_instantiate(mntroot, inode); + if (!mntroot->d_op) mntroot->d_op =3D server->nfs_client->rpc_ops->dentry_ops; =20 @@ -296,6 +299,8 @@ struct dentry *nfs4_get_root(struct supe return ERR_PTR(-ENOMEM); } =20 + security_d_instantiate(mntroot, inode); + if (!mntroot->d_op) mntroot->d_op =3D server->nfs_client->rpc_ops->dentry_ops; =20