Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:11 +0200
commit6c3c370a9a36031669389f1f221ff1d12168bc2e (patch)
treec0bbbd76a871929efe5c9a91454899ed82069a81
parenta2ebdefd19237cefe9e2277ffb506b09b010fdd3 (diff)
NFSv4: Fix an Oops in nfs4_do_setattr (bnc#1012628).
-rw-r--r--patches.kernel.org/5.2.9-136-NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-136-NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch b/patches.kernel.org/5.2.9-136-NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch
new file mode 100644
index 0000000000..72b5ecdddc
--- /dev/null
+++ b/patches.kernel.org/5.2.9-136-NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch
@@ -0,0 +1,39 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Sat, 3 Aug 2019 10:28:18 -0400
+Subject: [PATCH] NFSv4: Fix an Oops in nfs4_do_setattr
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: 09a54f0ebfe263bc27c90bbd80187b9a93283887
+
+commit 09a54f0ebfe263bc27c90bbd80187b9a93283887 upstream.
+
+If the user specifies an open mode of 3, then we don't have a NFSv4 state
+attached to the context, and so we Oops when we try to dereference it.
+
+Reported-by: Olga Kornievskaia <aglo@umich.edu>
+Fixes: 29b59f9416937 ("NFSv4: change nfs4_do_setattr to take...")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: stable@vger.kernel.org # v4.10: 991eedb1371dc: NFSv4: Only pass the...
+Cc: stable@vger.kernel.org # v4.10+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/nfs/nfs4proc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
+index fe02a4f6f6d3..63edda145d1b 100644
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -3175,7 +3175,7 @@ static int _nfs4_do_setattr(struct inode *inode,
+
+ if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) {
+ /* Use that stateid */
+- } else if (ctx != NULL) {
++ } else if (ctx != NULL && ctx->state) {
+ struct nfs_lock_context *l_ctx;
+ if (!nfs4_valid_open_stateid(ctx->state))
+ return -EBADF;
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index bb080f2591..83fd70ff1b 100644
--- a/series.conf
+++ b/series.conf
@@ -1156,6 +1156,7 @@
patches.kernel.org/5.2.9-133-smb3-send-CAP_DFS-capability-during-session-set.patch
patches.kernel.org/5.2.9-134-NFSv4-Fix-delegation-state-recovery.patch
patches.kernel.org/5.2.9-135-NFSv4-Check-the-return-value-of-update_open_sta.patch
+ patches.kernel.org/5.2.9-136-NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch
########################################################
# Build fixes that apply to the vanilla kernel too.