From: Trond Myklebust Date: Sat, 7 Sep 2013 21:49:05 +0000 (-0400) Subject: NFSv4: Disallow security negotiation for lookups when 'sec=' is specified X-Git-Tag: v5.15~19320^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41d058c3ba7bd16c3a91b9ec4d89fb6e7d4b4316;p=platform%2Fkernel%2Flinux-starfive.git NFSv4: Disallow security negotiation for lookups when 'sec=' is specified Ensure that nfs4_proc_lookup_common respects the NFS_MOUNT_SECFLAVOUR flag. Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 68551ea..122b934 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3154,7 +3154,9 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir, err = -EPERM; if (client != *clnt) goto out; - + /* No security negotiation if the user specified 'sec=' */ + if (NFS_SERVER(dir)->flags & NFS_MOUNT_SECFLAVOUR) + goto out; client = nfs4_create_sec_client(client, dir, name); if (IS_ERR(client)) return PTR_ERR(client);