From b30bef171ac0591477611183af732c76fdf21410 Mon Sep 17 00:00:00 2001 From: ZhangXiaoxu Date: Mon, 29 Apr 2019 19:44:04 +0800 Subject: [PATCH] SUNRPC: task should be exit if encode return EKEYEXPIRED more times euler inclusion category: bugfix bugzilla: 14217 CVE: NA ------------------------------------------------- If the rpc.gssd always return cred success, but now the cred is expired(dected when encode the task), then the task will loop in call_refresh and call_transmit. Exit the rpc task after retry. Link: https://patchwork.kernel.org/patch/10921577/ Signed-off-by: ZhangXiaoxu Reviewed-by: Hou Tao Signed-off-by: Yang Yingliang --- net/sunrpc/clnt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 0339c16ef970..3fdf7883cc05 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1962,8 +1962,11 @@ call_transmit(struct rpc_task *task) /* Was the error nonfatal? */ if (task->tk_status == -EAGAIN) rpc_delay(task, HZ >> 4); - else if (task->tk_status == -EKEYEXPIRED) + else if (task->tk_status == -EKEYEXPIRED && + task->tk_cred_retry) { + task->tk_cred_retry--; task->tk_action = call_refresh; + } else rpc_exit(task, task->tk_status); return; -- GitLab