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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e1f17a7b53760467defc7055ce1bd11d7e8f80cb.1581282103.git.jbi.octave@gmail.com>
Date:   Sun,  9 Feb 2020 22:44:04 +0000
From:   Jules Irenge <jbi.octave@...il.com>
To:     boqun.feng@...il.com
Cc:     linux-fsdevel@...r.kernel.org, viro@...iv.linux.org.uk,
        linux-kernel@...r.kernel.org, Jules Irenge <jbi.octave@...il.com>
Subject: [PATCH 07/11] fs_pin: Add missing annotation for pin_kill() declaration

Sparse reports warnings within the kernel acct.c file
at acct_exit_ns(), __se_sys_acct(), acct_on()

warning: context imbalance in acct_on()
	- different lock contexts for basic block
warning: context imbalance in __se_sys_acct()
	- different lock contexts for basic block
warning: context imbalance in acct_exit_ns()
	- wrong count at exit

The root cause is the missing annotation at pin_kill()

In fact acct_exit_ns(), __se_sys_sys_acct() and acct_on()
 do actually call rcu_read_lock()
then call pin_kill() which is defined elsewhere.
A close look at pin_kill()
- called 3 times in the core kernel and 2 times elsewhere-
shows that pin_kill() does actually call rcu_read_unlock().
Adding the annotation at declaration and definition of pin_kill()
not only fixes the warnings
but also improves on the readability of the code

Add the missing annotation __release(RCU)

Signed-off-by: Jules Irenge <jbi.octave@...il.com>
---
 include/linux/fs_pin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fs_pin.h b/include/linux/fs_pin.h
index bdd09fd2520c..d2fcf1a5112f 100644
--- a/include/linux/fs_pin.h
+++ b/include/linux/fs_pin.h
@@ -21,4 +21,4 @@ static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
 
 void pin_remove(struct fs_pin *);
 void pin_insert(struct fs_pin *, struct vfsmount *);
-void pin_kill(struct fs_pin *);
+void pin_kill(struct fs_pin *) __releases(RCU);
-- 
2.24.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ