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-next>] [day] [month] [year] [list]
Message-Id: <20240911182853.19634-1-adiupina@astralinux.ru>
Date: Wed, 11 Sep 2024 21:28:53 +0300
From: Alexandra Diupina <adiupina@...ralinux.ru>
To: David Howells <dhowells@...hat.com>
Cc: Alexandra Diupina <adiupina@...ralinux.ru>,
	Marc Dionne <marc.dionne@...istor.com>,
	linux-afs@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org
Subject: [PATCH] afs: Fix checking wait_event_interruptible() return value

The if-block in question is presumably supposed to handle
wait_event_interruptible() failure, i.e. when it returns -ERESTARTSYS
due to signal received by the task instead of a zero value.

Fix the condition appropriately.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 4be5975aea15 ("afs: Further fix file locking")
Signed-off-by: Alexandra Diupina <adiupina@...ralinux.ru>
---
 fs/afs/flock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index f0e96a35093f..2dba323b3395 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -652,7 +652,7 @@ static int afs_do_setlk(struct file *file, struct file_lock *fl)
 			fl->fl_u.afs.state = AFS_LOCK_PENDING;
 			goto try_to_lock;
 		case AFS_LOCK_PENDING:
-			if (ret > 0) {
+			if (ret < 0) {
 				/* We need to retry the lock.  We may not be
 				 * notified by the server if it just expired
 				 * rather than being released.
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ