summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-02-05 21:06:09 +0000
committerrwatson <rwatson@FreeBSD.org>2006-02-05 21:06:09 +0000
commit8b356bb2d71d51c2f4e3e21940c236964e1c5b3c (patch)
treec2832482b05618bdf96d3398a4a35093c20bdf7a /sys/security
parent29de4be4fa86c57ac7b74ed74857528a3f8991b7 (diff)
downloadFreeBSD-src-8b356bb2d71d51c2f4e3e21940c236964e1c5b3c.zip
FreeBSD-src-8b356bb2d71d51c2f4e3e21940c236964e1c5b3c.tar.gz
When GC'ing a thread, assert that it has no active audit record.
This should not happen, but with this assert, brueffer and I would not have spent 45 minutes trying to figure out why he wasn't seeing audit records with the audit version in CVS. Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit.c10
-rw-r--r--sys/security/audit/audit.h1
2 files changed, 11 insertions, 0 deletions
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