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: <BL1PR11MB5478DB9FA9C2BEF56FBFF6AAFFE89@BL1PR11MB5478.namprd11.prod.outlook.com>
Date:   Mon, 26 Jul 2021 07:43:33 +0000
From:   "Zhang, Qiang" <Qiang.Zhang@...driver.com>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
CC:     "linux-rt-users@...r.kernel.org" <linux-rt-users@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Question on (locking: Make spinlock_t and rwlock_t a RCU section on
 RT)

Hello,  I have some questions about this patch 

From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Date: Tue, 19 Nov 2019 09:25:04 +0100
Subject: [PATCH] locking: Make spinlock_t and rwlock_t a RCU section on RT

On !RT a locked spinlock_t and rwlock_t disables preemption which
implies a RCU read section. There is code that relies on that behaviour.

Add an explicit RCU read section on RT while a sleeping lock (a lock
which would disables preemption on !RT) acquired.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
---
 kernel/locking/rtmutex.c   |    6 ++++++
 kernel/locking/rwlock-rt.c |    6 ++++++
 2 files changed, 12 insertions(+)

--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1136,6 +1136,7 @@ void __lockfunc rt_spin_lock(spinlock_t
 {
        spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
        rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock);
+       rcu_read_lock();
        migrate_disable();
...............................

Operation of sleep is not allowed in RCU read critical area,  If  after acquiring a rt-spinlock , try to acquire another one rt-spinlock,  This may cause sleep, and trigger RCU warning.  

Is there a problem with my analysis or something I missed?

Thanks
Qiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ