diff options
-rw-r--r-- | kernel/auditsc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index d3d499272d13..b613ec89e99c 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -704,10 +704,14 @@ void audit_free(struct task_struct *tsk) { struct audit_context *context; - task_lock(tsk); + /* + * No need to lock the task - when we execute audit_free() + * then the task has no external references anymore, and + * we are tearing it down. (The locking also confuses + * DEBUG_LOCKDEP - this freeing may occur in softirq + * contexts as well, via RCU.) + */ context = audit_get_context(tsk, 0, 0); - task_unlock(tsk); - if (likely(!context)) return; |