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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210406221952.50399-1-ahalaney@redhat.com>
Date:   Tue,  6 Apr 2021 17:19:52 -0500
From:   Andrew Halaney <ahalaney@...hat.com>
To:     bigeasy@...utronix.de
Cc:     linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org,
        Andrew Halaney <ahalaney@...hat.com>,
        Chunyu Hu <chuhu@...hat.com>
Subject: [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read()

There's no chance of sleeping here, the reader is giving up the
lock and possibly waking up the writer who is waiting on it.

Reported-by: Chunyu Hu <chuhu@...hat.com>
Signed-off-by: Andrew Halaney <ahalaney@...hat.com>
---
Hello,

I ran into a warning caused by this, and I think the warning is
incorrect. Please let me know if I'm wrong!
I'm working off of linux-5.12.y-rt, but this applies cleanly to older
stable branches as well.

Thanks,
Andrew

 kernel/locking/rwsem-rt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c
index 274172d5bb3a..b61edc4dcb73 100644
--- a/kernel/locking/rwsem-rt.c
+++ b/kernel/locking/rwsem-rt.c
@@ -198,7 +198,6 @@ void __up_read(struct rw_semaphore *sem)
 	if (!atomic_dec_and_test(&sem->readers))
 		return;
 
-	might_sleep();
 	raw_spin_lock_irq(&m->wait_lock);
 	/*
 	 * Wake the writer, i.e. the rtmutex owner. It might release the
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ