Skip to contentSkip to conversation

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

PATCH [email protected] 1 participant 1 message Oct 5, 2016

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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.4-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.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 0533b13072f4bf35738290d2cf9e299c7bc6c42a Mon Sep 17 00:00:00 2001

From: Chuck Lever <[email protected]>
Date: Wed, 29 Jun 2016 13:55:14 -0400
Subject: svc: Avoid garbage replies when pc_func() returns rpc_drop_reply

From: Chuck Lever <[email protected]>

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")
---
 net/sunrpc/svc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/sunrpc/svc.c +2 -1
@@ -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 [email protected] are

queue-4.4/svc-avoid-garbage-replies-when-pc_func-returns-rpc_drop_reply.patch queue-4.4/nfs-don-t-drop-cb-requests-with-invalid-principals.patch