Commit 54134be6 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 23d04328 ce2fc710
...@@ -77,7 +77,7 @@ void selinux_ima_measure_state_locked(struct selinux_state *state) ...@@ -77,7 +77,7 @@ void selinux_ima_measure_state_locked(struct selinux_state *state)
size_t policy_len; size_t policy_len;
int rc = 0; int rc = 0;
WARN_ON(!mutex_is_locked(&state->policy_mutex)); lockdep_assert_held(&state->policy_mutex);
state_str = selinux_ima_collect_state(state); state_str = selinux_ima_collect_state(state);
if (!state_str) { if (!state_str) {
...@@ -117,7 +117,7 @@ void selinux_ima_measure_state_locked(struct selinux_state *state) ...@@ -117,7 +117,7 @@ void selinux_ima_measure_state_locked(struct selinux_state *state)
*/ */
void selinux_ima_measure_state(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); mutex_lock(&state->policy_mutex);
selinux_ima_measure_state_locked(state); selinux_ima_measure_state_locked(state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment