From: Greg Kroah-Hartman Date: Fri, 2 May 2014 02:38:14 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.4.89~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09bfdd4615f5bdd5e4eb1dfd4cb00b3e7a37b12b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: nfsd4-fix-setclientid-encode-size.patch nfsd-notify_change-needs-elevated-write-count.patch --- diff --git a/queue-3.4/nfsd-notify_change-needs-elevated-write-count.patch b/queue-3.4/nfsd-notify_change-needs-elevated-write-count.patch new file mode 100644 index 00000000000..444e37e764b --- /dev/null +++ b/queue-3.4/nfsd-notify_change-needs-elevated-write-count.patch @@ -0,0 +1,51 @@ +From 9f67f189939eccaa54f3d2c9cf10788abaf2d584 Mon Sep 17 00:00:00 2001 +From: "J. Bruce Fields" +Date: Mon, 24 Feb 2014 14:59:47 -0500 +Subject: nfsd: notify_change needs elevated write count + +From: "J. Bruce Fields" + +commit 9f67f189939eccaa54f3d2c9cf10788abaf2d584 upstream. + +Looks like this bug has been here since these write counts were +introduced, not sure why it was just noticed now. + +Thanks also to Jan Kara for pointing out the problem. + +Reported-by: Matthew Rahtz +Signed-off-by: J. Bruce Fields +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfsd/vfs.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/fs/nfsd/vfs.c ++++ b/fs/nfsd/vfs.c +@@ -406,6 +406,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str + umode_t ftype = 0; + __be32 err; + int host_err; ++ bool get_write_count; + int size_change = 0; + + if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE)) +@@ -413,10 +414,18 @@ nfsd_setattr(struct svc_rqst *rqstp, str + if (iap->ia_valid & ATTR_SIZE) + ftype = S_IFREG; + ++ /* Callers that do fh_verify should do the fh_want_write: */ ++ get_write_count = !fhp->fh_dentry; ++ + /* Get inode */ + err = fh_verify(rqstp, fhp, ftype, accmode); + if (err) + goto out; ++ if (get_write_count) { ++ host_err = fh_want_write(fhp); ++ if (host_err) ++ return nfserrno(host_err); ++ } + + dentry = fhp->fh_dentry; + inode = dentry->d_inode; diff --git a/queue-3.4/nfsd4-fix-setclientid-encode-size.patch b/queue-3.4/nfsd4-fix-setclientid-encode-size.patch new file mode 100644 index 00000000000..74d84cfb796 --- /dev/null +++ b/queue-3.4/nfsd4-fix-setclientid-encode-size.patch @@ -0,0 +1,28 @@ +From 480efaee085235bb848f1063f959bf144103c342 Mon Sep 17 00:00:00 2001 +From: "J. Bruce Fields" +Date: Mon, 10 Mar 2014 14:17:55 -0400 +Subject: nfsd4: fix setclientid encode size + +From: "J. Bruce Fields" + +commit 480efaee085235bb848f1063f959bf144103c342 upstream. + +Signed-off-by: J. Bruce Fields +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfsd/nfs4proc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/nfsd/nfs4proc.c ++++ b/fs/nfsd/nfs4proc.c +@@ -1418,7 +1418,8 @@ static inline u32 nfsd4_setattr_rsize(st + + static inline u32 nfsd4_setclientid_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) + { +- return (op_encode_hdr_size + 2 + 1024) * sizeof(__be32); ++ return (op_encode_hdr_size + 2 + XDR_QUADLEN(NFS4_VERIFIER_SIZE)) * ++ sizeof(__be32); + } + + static inline u32 nfsd4_write_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) diff --git a/queue-3.4/series b/queue-3.4/series index 2481c2f7d9d..fd270b690a4 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -17,3 +17,5 @@ usb-fix-crash-during-hotplug-of-pci-usb-controller-card.patch nfsd4-session-needs-room-for-following-op-to-error-out.patch nfsd4-buffer-length-check-for-suppattr_exclcreat.patch nfsd4-fix-test_stateid-error-reply-encoding.patch +nfsd-notify_change-needs-elevated-write-count.patch +nfsd4-fix-setclientid-encode-size.patch