summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_thread.c4
-rw-r--r--sys/security/audit/audit.c10
-rw-r--r--sys/security/audit/audit.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 2777ca7..d36ae2e 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -172,7 +172,9 @@ thread_dtor(void *mem, int size, void *arg)
/* NOTREACHED */
}
#endif
-
+#ifdef AUDIT
+ audit_thread_free(td);
+#endif
free_unr(tid_unrhdr, td->td_tid);
sched_newthread(td);
}
diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c
index 1d3c3e6..5d431b1 100644
--- a/sys/security/audit/audit.c
+++ b/sys/security/audit/audit.c
@@ -1025,6 +1025,16 @@ audit_thread_alloc(struct thread *td)
td->td_ar = NULL;
}
+/*
+ * Thread destruction.
+ */
+void
+audit_thread_free(struct thread *td)
+{
+
+ KASSERT(td->td_ar == NULL, ("audit_thread_free: td_ar != NULL"));
+}
+
/*
* Initialize the audit information for the a process, presumably the first
* process in the system.
diff --git a/sys/security/audit/audit.h b/sys/security/audit/audit.h
index 7421f0d..d471c9c 100644
--- a/sys/security/audit/audit.h
+++ b/sys/security/audit/audit.h
@@ -180,6 +180,7 @@ void audit_proc_fork(struct proc *parent,
struct proc *child);
void audit_proc_free(struct proc *p);
void audit_thread_alloc(struct thread *td);
+void audit_thread_free(struct thread *td);
/*
* Define a macro to wrap the audit_arg_* calls by checking the global
OpenPOWER on IntegriCloud