]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r336205:
authorasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 3 Aug 2018 14:45:53 +0000 (14:45 +0000)
committerasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 3 Aug 2018 14:45:53 +0000 (14:45 +0000)
commit9561f88a3d39a58b8f71a65e8225519635a572f1
tree44095f8dc9a34edef16726861d1577e0cd861b50
parent20076b4270f2ae2a97f716f899a8d9258fa3efd2
MFC r336205:

Don't acquire evclass_lock with a spinlock held

When the "pc" audit class is enabled and auditd is running, witness will
panic during thread exit because au_event_class tries to lock an rwlock
while holding a spinlock acquired upstack by thread_exit.

To fix this, move AUDIT_SYSCALL_EXIT futher upstack, before the spinlock is
acquired. Of thread_exit's 16 callers, it's only necessary to call
AUDIT_SYSCALL_EXIT from two, exit1 (for exiting processes) and kern_thr_exit
(for exiting threads). The other callers are all kernel threads, which
needen't call AUDIT_SYSCALL_EXIT because since they can't make syscalls
there will be nothing to audit.  And exit1 already does call
AUDIT_SYSCALL_EXIT, making the second call in thread_exit redundant for that
case.

PR: 228444
Reported by: aniketp
Reviewed by: aniketp, kib
Differential Revision: https://reviews.freebsd.org/D16210

git-svn-id: svn://svn.freebsd.org/base/stable/10@337258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/kern_thr.c
sys/kern/kern_thread.c