summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c5
-rw-r--r--sys/kern/kern_exit.c3
-rw-r--r--sys/kern/kern_fork.c9
-rw-r--r--sys/kern/kern_prot.c9
4 files changed, 11 insertions, 15 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 0be3af3..10996e7 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -441,8 +441,7 @@ proc0_init(void *dummy __unused)
p->p_ucred->cr_ruidinfo = uifind(0);
p->p_ucred->cr_prison = NULL; /* Don't jail it. */
#ifdef AUDIT
- audit_proc_alloc(p);
- audit_proc_kproc0(p);
+ audit_cred_kproc0(p->p_ucred);
#endif
#ifdef MAC
mac_create_proc0(p->p_ucred);
@@ -707,7 +706,7 @@ create_init(const void *udata __unused)
mac_create_proc1(newcred);
#endif
#ifdef AUDIT
- audit_proc_init(initproc);
+ audit_cred_proc1(newcred);
#endif
initproc->p_ucred = newcred;
PROC_UNLOCK(initproc);
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 9cab321..eefe6b0 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -811,9 +811,6 @@ loop:
#ifdef MAC
mac_destroy_proc(p);
#endif
-#ifdef AUDIT
- audit_proc_free(p);
-#endif
KASSERT(FIRST_THREAD_IN_PROC(p),
("kern_wait: no residual thread!"));
uma_zfree(proc_zone, p);
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index ae3531c..04b31d4 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -279,9 +279,6 @@ fork1(td, flags, pages, procp)
#ifdef MAC
mac_init_proc(newproc);
#endif
-#ifdef AUDIT
- audit_proc_alloc(newproc);
-#endif
knlist_init(&newproc->p_klist, &newproc->p_mtx, NULL, NULL, NULL);
STAILQ_INIT(&newproc->p_ktr);
@@ -510,9 +507,6 @@ again:
p2->p_sflag = PS_INMEM;
PROC_SUNLOCK(p2);
td2->td_ucred = crhold(p2->p_ucred);
-#ifdef AUDIT
- audit_proc_fork(p1, p2);
-#endif
pargs_hold(p2->p_args);
if (flags & RFSIGSHARE) {
@@ -753,9 +747,6 @@ fail:
#ifdef MAC
mac_destroy_proc(newproc);
#endif
-#ifdef AUDIT
- audit_proc_free(newproc);
-#endif
uma_zfree(proc_zone, newproc);
if (p1->p_flag & P_HADTHREADS) {
PROC_LOCK(p1);
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index a11825a..36a5dc4 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1763,6 +1763,9 @@ crget(void)
MALLOC(cr, struct ucred *, sizeof(*cr), M_CRED, M_WAITOK | M_ZERO);
refcount_init(&cr->cr_ref, 1);
+#ifdef AUDIT
+ audit_cred_init(cr);
+#endif
#ifdef MAC
mac_init_cred(cr);
#endif
@@ -1804,6 +1807,9 @@ crfree(struct ucred *cr)
*/
if (jailed(cr))
prison_free(cr->cr_prison);
+#ifdef AUDIT
+ audit_cred_destroy(cr);
+#endif
#ifdef MAC
mac_destroy_cred(cr);
#endif
@@ -1836,6 +1842,9 @@ crcopy(struct ucred *dest, struct ucred *src)
uihold(dest->cr_ruidinfo);
if (jailed(dest))
prison_hold(dest->cr_prison);
+#ifdef AUDIT
+ audit_cred_copy(src, dest);
+#endif
#ifdef MAC
mac_copy_cred(src, dest);
#endif
OpenPOWER on IntegriCloud