From 9760576d079c33fa097f780b1d620a378a191448 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Fri, 30 Apr 2021 15:36:05 +0800 Subject: [PATCH] SUNRPC: If there is no reply expected, bail early from call_decode mainline inclusion from mainline-4.20-rc1 commit 9ee94d3ed6a4f75dbf0a022927021a42a24dbdf8 category: bugfix bugzilla: 51820 CVE: NA ------------------------------------------------- Signed-off-by: Trond Myklebust Signed-off-by: Huang Guobin Reviewed-by: Yue Haibing Signed-off-by: Yang Yingliang --- net/sunrpc/clnt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index ccd5d5735be1..abdae040d229 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2264,6 +2264,11 @@ call_decode(struct rpc_task *task) dprint_status(task); + if (!decode) { + task->tk_action = rpc_exit_task; + return; + } + if (task->tk_flags & RPC_CALL_MAJORSEEN) { if (clnt->cl_chatty) { printk(KERN_NOTICE "%s: server %s OK\n", @@ -2301,13 +2306,11 @@ call_decode(struct rpc_task *task) goto out_retry; return; } - task->tk_action = rpc_exit_task; - if (decode) { - task->tk_status = rpcauth_unwrap_resp(task, decode, req, p, - task->tk_msg.rpc_resp); - } + task->tk_status = rpcauth_unwrap_resp(task, decode, req, p, + task->tk_msg.rpc_resp); + dprintk("RPC: %5u call_decode result %d\n", task->tk_pid, task->tk_status); return; -- GitLab