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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 21 Apr 2021 19:51:44 -0700
From:   zhouchuangao <zhouchuangao@...o.com>
To:     Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     zhouchuangao <zhouchuangao@...o.com>
Subject: [PATCH] fs/nfs: Use fatal_signal_pending instead of signal_pending.

We set the state of the current process to TASK_KILLABLE via
prepare_to_wait(). Should we use fatal_signal_pending() to detect
the signal here?

Signed-off-by: zhouchuangao <zhouchuangao@...o.com>
---
 fs/nfs/nfs4proc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c65c4b4..127be294 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1681,13 +1681,13 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
 		rcu_read_unlock();
 		trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0);
 
-		if (!signal_pending(current)) {
+		if (!fatal_signal_pending(current)) {
 			if (schedule_timeout(5*HZ) == 0)
 				status = -EAGAIN;
 			else
 				status = 0;
 		} else
-			status = -EINTR;
+			status = -ERESTARTSYS;
 		finish_wait(&state->waitq, &wait);
 		rcu_read_lock();
 		spin_lock(&state->owner->so_lock);
@@ -3457,8 +3457,8 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
 		write_sequnlock(&state->seqlock);
 		trace_nfs4_close_stateid_update_wait(state->inode, dst, 0);
 
-		if (signal_pending(current))
-			status = -EINTR;
+		if (fatal_signal_pending(current))
+			status = -ERESTARTSYS;
 		else
 			if (schedule_timeout(5*HZ) != 0)
 				status = 0;
@@ -3467,7 +3467,7 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
 
 		if (!status)
 			continue;
-		if (status == -EINTR)
+		if (status == -ERESTARTSYS)
 			break;
 
 		/* we slept the whole 5 seconds, we must have lost a seqid */
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ