lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Dec 2021 21:53:38 +0800
From:   Bixuan Cui <cuibixuan@...ux.alibaba.com>
To:     linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        linux-nfs@...r.kernel.org
Cc:     cuibixuan@...ux.alibaba.com, bfields@...ldses.org,
        chuck.lever@...cle.com, trond.myklebust@...merspace.com,
        anna.schumaker@...app.com, davem@...emloft.net, kuba@...nel.org,
        pete.wl@...baba-inc.com, wenan.mwa@...baba-inc.com,
        xiaoh.peixh@...baba-inc.com, weipu.zy@...baba-inc.com
Subject: [PATCH -next] SUNRPC: Clean XPRT_CONGESTED of xprt->state when rpc task is killed

When the values of tcp_max_slot_table_entries and
sunrpc.tcp_slot_table_entries are lower than the number of rpc tasks,
xprt_dynamic_alloc_slot() in xprt_alloc_slot() will return -EAGAIN, and
then set xprt->state to XPRT_CONGESTED:
  xprt_retry_reserve
    ->xprt_do_reserve
      ->xprt_alloc_slot
        ->xprt_dynamic_alloc_slot // return -EAGAIN and task->tk_rqstp is NULL
          ->xprt_add_backlog // set_bit(XPRT_CONGESTED, &xprt->state);

When rpc task is killed, XPRT_CONGESTED bit of xprt->state will not be
cleaned up and nfs hangs:
  rpc_exit_task
    ->xprt_release // if (req == NULL) is true, then XPRT_CONGESTED
		   // bit not clean

Add xprt_wake_up_backlog(xprt) to clean XPRT_CONGESTED bit in
xprt_release().

Signed-off-by: Bixuan Cui <cuibixuan@...ux.alibaba.com>
Signed-off-by: Xiaohui Pei <xiaoh.peixh@...baba-inc.com>
---
 net/sunrpc/xprt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index a02de2b..70d11ae 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1952,6 +1952,7 @@ void xprt_release(struct rpc_task *task)
 	if (req == NULL) {
 		if (task->tk_client) {
 			xprt = task->tk_xprt;
+			xprt_wake_up_backlog(xprt);
 			xprt_release_write(xprt, task);
 		}
 		return;
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ