Patch "svc: Avoid garbage replies when pc_func() returns rpc_drop_reply" has been added to the 4.7-stable tree

From: <gregkh@linuxfoundation.org>
Date: 2016-10-05 13:23:14

This is a note to let you know that I've just added the patch titled

    svc: Avoid garbage replies when pc_func() returns rpc_drop_reply

to the 4.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     svc-avoid-garbage-replies-when-pc_func-returns-rpc_drop_reply.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let [off-list ref] know about it.

From 0533b13072f4bf35738290d2cf9e299c7bc6c42a Mon Sep 17 00:00:00 2001
From: Chuck Lever <redacted>
Date: Wed, 29 Jun 2016 13:55:14 -0400
Subject: svc: Avoid garbage replies when pc_func() returns rpc_drop_reply

From: Chuck Lever <redacted>

commit 0533b13072f4bf35738290d2cf9e299c7bc6c42a upstream.

If an RPC program does not set vs_dispatch and pc_func() returns
rpc_drop_reply, the server sends a reply anyway containing a single
word containing the value RPC_DROP_REPLY (in network byte-order, of
course). This is a nonsense RPC message.

Fixes: 9e701c610923 ("svcrpc: simpler request dropping")
Signed-off-by: Chuck Lever <redacted>
Tested-by: Steve Wise <redacted>
Signed-off-by: Anna Schumaker <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/svc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1188,7 +1188,8 @@ svc_process_common(struct svc_rqst *rqst
 		*statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
 
 		/* Encode reply */
-		if (test_bit(RQ_DROPME, &rqstp->rq_flags)) {
+		if (*statp == rpc_drop_reply ||
+		    test_bit(RQ_DROPME, &rqstp->rq_flags)) {
 			if (procp->pc_release)
 				procp->pc_release(rqstp, NULL, rqstp->rq_resp);
 			goto dropit;

Patches currently in stable-queue which might be from chuck.lever@oracle.com are

queue-4.7/xprtrdma-remove-fmrs-from-the-unmap-list-after-unmapping.patch
queue-4.7/svc-avoid-garbage-replies-when-pc_func-returns-rpc_drop_reply.patch
queue-4.7/nfs-don-t-drop-cb-requests-with-invalid-principals.patch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help