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]
Message-Id: <20200120224154.51683-1-jbi.octave@gmail.com>
Date:   Mon, 20 Jan 2020 22:41:54 +0000
From:   Jules Irenge <jbi.octave@...il.com>
To:     paulmck@...nel.org
Cc:     rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
        joel@...lfernandes.org, rcu@...r.kernel.org, iangshanlai@...il.com,
        boqun.feng@...il.com, linux-kernel@...r.kernel.org,
        Jules Irenge <jbi.octave@...il.com>
Subject: [PATCH 3/5] rcu: Add missing annotation for exit_tasks_rcu_finish()

Sparse reports a warning at exit_tasks_rcu_finish(void)

|warning: context imbalance in exit_tasks_rcu_finish()
|- wrong count at exit

To fix this, an __releases(&tasks_rcu_exit_srcu) is added.
Given that exit_tasks_rcu_finish() does actually call __srcu_read_lock().
This not only fixes the warning
but also improves on the readability of the code.

Signed-off-by: Jules Irenge <jbi.octave@...il.com>
---
 kernel/rcu/update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 99f4e617116b..5853f19f0cb5 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -809,7 +809,7 @@ void exit_tasks_rcu_start(void) __acquires(&tasks_rcu_exit_srcu)
 }
 
 /* Do the srcu_read_unlock() for the above synchronize_srcu().  */
-void exit_tasks_rcu_finish(void)
+void exit_tasks_rcu_finish(void) __releases(&tasks_rcu_exit_srcu)
 {
 	preempt_disable();
 	__srcu_read_unlock(&tasks_rcu_exit_srcu, current->rcu_tasks_idx);
-- 
2.24.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ