Merge kern_exit.c:1.277, kern_fork.c:1.254 from HEAD to RELENG_6:
Hook up audit to fork() and exit() events. These changes manage the audit state on processes, not auditing of these events. Obtained from: TrustedBSD Project
This commit is contained in:
parent
4fecaa2b4a
commit
a4006541ce
@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/ktrace.h>
|
||||
#endif
|
||||
|
||||
#include <security/audit/audit.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_extern.h>
|
||||
#include <vm/vm_param.h>
|
||||
@ -704,6 +706,9 @@ loop:
|
||||
vm_waitproc(p);
|
||||
#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!"));
|
||||
|
@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/sx.h>
|
||||
#include <sys/signalvar.h>
|
||||
|
||||
#include <security/audit/audit.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_map.h>
|
||||
@ -286,6 +288,9 @@ fork1(td, flags, pages, procp)
|
||||
newproc = uma_zalloc(proc_zone, M_WAITOK);
|
||||
#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);
|
||||
|
||||
@ -507,7 +512,9 @@ again:
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
p2->p_ucred = crhold(td->td_ucred);
|
||||
td2->td_ucred = crhold(p2->p_ucred); /* XXXKSE */
|
||||
|
||||
#ifdef AUDIT
|
||||
audit_proc_fork(p1, p2);
|
||||
#endif
|
||||
pargs_hold(p2->p_args);
|
||||
|
||||
if (flags & RFSIGSHARE) {
|
||||
@ -745,6 +752,9 @@ fail:
|
||||
sx_xunlock(&allproc_lock);
|
||||
#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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user