From: Chuck Lever Date: Wed, 29 Jun 2016 17:55:14 +0000 (-0400) Subject: svc: Avoid garbage replies when pc_func() returns rpc_drop_reply X-Git-Tag: v3.10.105~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=824c2230ed7a87dad0ee1b0511dac7717f822517;p=thirdparty%2Fkernel%2Fstable.git svc: Avoid garbage replies when pc_func() returns rpc_drop_reply 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 Tested-by: Steve Wise Signed-off-by: Anna Schumaker Signed-off-by: Willy Tarreau --- diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 6dee8fbb3b113..c996a71fc9f16 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1182,7 +1182,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) *statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp); /* Encode reply */ - if (rqstp->rq_dropme) { + if (*statp == rpc_drop_reply || + rqstp->rq_dropme) { if (procp->pc_release) procp->pc_release(rqstp, NULL, rqstp->rq_resp); goto dropit;