summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-02-24 02:19:55 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2022-02-24 02:19:55 +0100
commit54134be6580364ab98db09eb8070a09bb02e37ae (patch)
treee87b395d63f60e1acdafbd3e5fd5ae1c2ec324f5 /security
parentMerge tag 'for-5.17/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
parentselinux: fix misuse of mutex_is_locked() (diff)
downloadlinux-54134be6580364ab98db09eb8070a09bb02e37ae.tar.xz
linux-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.c4
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);