diff options
author | Paul Moore <paul@paul-moore.com> | 2018-02-20 09:52:38 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2018-02-23 11:22:22 -0500 |
commit | ce423631ce1f20564f818e7de6bc0eee0c01badd (patch) | |
tree | 8af35df7e249950085f24e6842b6d0058c6893c7 /kernel/audit_tree.c | |
parent | 23138ead270045f1b3e912e667967b6094244999 (diff) |
audit: track the owner of the command mutex ourselves
Evidently the __mutex_owner() function was never intended for use
outside the core mutex code, so build a thing locking wrapper around
the mutex code which allows us to track the mutex owner.
One, arguably positive, side effect is that this allows us to hide
the audit_cmd_mutex inside of kernel/audit.c behind the lock/unlock
functions.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/audit_tree.c')
-rw-r--r-- | kernel/audit_tree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c index fd353120e0d9..67e6956c0b61 100644 --- a/kernel/audit_tree.c +++ b/kernel/audit_tree.c | |||
@@ -709,7 +709,7 @@ static int prune_tree_thread(void *unused) | |||
709 | schedule(); | 709 | schedule(); |
710 | } | 710 | } |
711 | 711 | ||
712 | mutex_lock(&audit_cmd_mutex); | 712 | audit_ctl_lock(); |
713 | mutex_lock(&audit_filter_mutex); | 713 | mutex_lock(&audit_filter_mutex); |
714 | 714 | ||
715 | while (!list_empty(&prune_list)) { | 715 | while (!list_empty(&prune_list)) { |
@@ -727,7 +727,7 @@ static int prune_tree_thread(void *unused) | |||
727 | } | 727 | } |
728 | 728 | ||
729 | mutex_unlock(&audit_filter_mutex); | 729 | mutex_unlock(&audit_filter_mutex); |
730 | mutex_unlock(&audit_cmd_mutex); | 730 | audit_ctl_unlock(); |
731 | } | 731 | } |
732 | return 0; | 732 | return 0; |
733 | } | 733 | } |
@@ -924,7 +924,7 @@ static void audit_schedule_prune(void) | |||
924 | */ | 924 | */ |
925 | void audit_kill_trees(struct list_head *list) | 925 | void audit_kill_trees(struct list_head *list) |
926 | { | 926 | { |
927 | mutex_lock(&audit_cmd_mutex); | 927 | audit_ctl_lock(); |
928 | mutex_lock(&audit_filter_mutex); | 928 | mutex_lock(&audit_filter_mutex); |
929 | 929 | ||
930 | while (!list_empty(list)) { | 930 | while (!list_empty(list)) { |
@@ -942,7 +942,7 @@ void audit_kill_trees(struct list_head *list) | |||
942 | } | 942 | } |
943 | 943 | ||
944 | mutex_unlock(&audit_filter_mutex); | 944 | mutex_unlock(&audit_filter_mutex); |
945 | mutex_unlock(&audit_cmd_mutex); | 945 | audit_ctl_unlock(); |
946 | } | 946 | } |
947 | 947 | ||
948 | /* | 948 | /* |