[ 3.5.y.z extended stable ] Patch "NFSv4: don't check MAY_WRITE access bit in OPEN" has been added to staging queue
Herton Ronaldo Krzesinski
herton.krzesinski at canonical.com
Tue Jan 15 22:21:04 UTC 2013
This is a note to let you know that I have just added a patch titled
NFSv4: don't check MAY_WRITE access bit in OPEN
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Herton
------
>From 962c1c2148b5fd5437b0e1619f8fff608675ede6 Mon Sep 17 00:00:00 2001
From: Weston Andros Adamson <dros at netapp.com>
Date: Tue, 2 Oct 2012 14:49:51 -0700
Subject: [PATCH] NFSv4: don't check MAY_WRITE access bit in OPEN
commit bbd3a8eee82a2a6f4aa1cce60ccb014f25e5c560 upstream.
Don't check MAY_WRITE as a newly created file may not have write mode bits,
but POSIX allows the creating process to write regardless.
This is ok because NFSv4 OPEN ops handle write permissions correctly -
the ACCESS in the OPEN compound is to differentiate READ v EXEC permissions.
Fixes a regression due to commit 6168f62c (NFSv4: Add ACCESS operation to
OPEN compound)
Signed-off-by: Weston Andros Adamson <dros at netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust at netapp.com>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
---
fs/nfs/nfs4proc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e527055..4ecc047 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1660,10 +1660,10 @@ static int nfs4_opendata_access(struct rpc_cred *cred,
return 0;
mask = 0;
+ /* don't check MAY_WRITE - a newly created file may not have
+ * write mode bits, but POSIX allows the creating process to write */
if (fmode & FMODE_READ)
mask |= MAY_READ;
- if (fmode & FMODE_WRITE)
- mask |= MAY_WRITE;
if (fmode & FMODE_EXEC)
mask |= MAY_EXEC;
@@ -1672,7 +1672,7 @@ static int nfs4_opendata_access(struct rpc_cred *cred,
nfs_access_set_mask(&cache, opendata->o_res.access_result);
nfs_access_add_cache(state->inode, &cache);
- if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0)
+ if ((mask & ~cache.mask & (MAY_READ | MAY_EXEC)) == 0)
return 0;
/* even though OPEN succeeded, access is denied. Close the file */
--
1.7.9.5
More information about the kernel-team
mailing list