[lkml]   [2016]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.16 060/346] svc: Avoid garbage replies when pc_func() returns rpc_drop_reply
3.16.39-rc1 review patch.  If anyone has any objections, please let me know.


From: Chuck Lever <>

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 <>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <>
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1189,7 +1189,7 @@ svc_process_common(struct svc_rqst *rqst
*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;
 \ /
  Last update: 2016-11-14 04:51    [W:0.772 / U:5.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site