diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-02-23 17:19:55 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-02-23 17:19:55 -0800 |
commit | 54134be6580364ab98db09eb8070a09bb02e37ae (patch) | |
tree | e87b395d63f60e1acdafbd3e5fd5ae1c2ec324f5 /security | |
parent | 23d04328444a8fa0ca060c5e532220dac8e8bc26 (diff) | |
parent | ce2fc710c9d2b25afc710f49bb2065b4439a62bc (diff) | |
download | lwn-54134be6580364ab98db09eb8070a09bb02e37ae.tar.gz lwn-54134be6580364ab98db09eb8070a09bb02e37ae.zip |
Merge tag 'selinux-pr-20220223' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fix from Paul Moore:
"A second small SELinux fix which addresses an incorrect
mutex_is_locked() check"
* tag 'selinux-pr-20220223' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
selinux: fix misuse of mutex_is_locked()
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/ima.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/ima.c b/security/selinux/ima.c index 727c4e43219d..ff7aea6b3774 100644 --- a/security/selinux/ima.c +++ b/security/selinux/ima.c @@ -77,7 +77,7 @@ void selinux_ima_measure_state_locked(struct selinux_state *state) size_t policy_len; int rc = 0; - WARN_ON(!mutex_is_locked(&state->policy_mutex)); + lockdep_assert_held(&state->policy_mutex); state_str = selinux_ima_collect_state(state); if (!state_str) { @@ -117,7 +117,7 @@ void selinux_ima_measure_state_locked(struct selinux_state *state) */ void selinux_ima_measure_state(struct selinux_state *state) { - WARN_ON(mutex_is_locked(&state->policy_mutex)); + lockdep_assert_not_held(&state->policy_mutex); mutex_lock(&state->policy_mutex); selinux_ima_measure_state_locked(state); |