summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwsalamon <wsalamon@FreeBSD.org>2006-02-04 20:37:20 +0000
committerwsalamon <wsalamon@FreeBSD.org>2006-02-04 20:37:20 +0000
commitece839695d4ce9f6b55bc2376db5b7be0896783e (patch)
tree2103937ae5be821523623fe0f04a26a9b823e217
parent3d601f5c0b2ed98326587270c5638a8315a2c25d (diff)
downloadFreeBSD-src-ece839695d4ce9f6b55bc2376db5b7be0896783e.zip
FreeBSD-src-ece839695d4ce9f6b55bc2376db5b7be0896783e.tar.gz
Call the audit syscall enter/exit functions for the amd64 architecture,
both 32-bit and 64-bit paths. System calls will now be audited. Obtained from: TrustedBSD Project Approved by: rwatson (mentor)
-rw-r--r--sys/amd64/amd64/trap.c8
-rw-r--r--sys/amd64/ia32/ia32_syscall.c3
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 6a8195b..d0d111b 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
#ifdef HWPMC_HOOKS
#include <sys/pmckern.h>
#endif
+#include <security/audit/audit.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -823,10 +824,15 @@ syscall(frame)
if ((callp->sy_narg & SYF_MPSAFE) == 0) {
mtx_lock(&Giant);
+ AUDIT_SYSCALL_ENTER(code, td);
error = (*callp->sy_call)(td, argp);
+ AUDIT_SYSCALL_EXIT(error, td);
mtx_unlock(&Giant);
- } else
+ } else {
+ AUDIT_SYSCALL_ENTER(code, td);
error = (*callp->sy_call)(td, argp);
+ AUDIT_SYSCALL_EXIT(error, td);
+ }
}
switch (error) {
diff --git a/sys/amd64/ia32/ia32_syscall.c b/sys/amd64/ia32/ia32_syscall.c
index 93d4e16..d8c16eb 100644
--- a/sys/amd64/ia32/ia32_syscall.c
+++ b/sys/amd64/ia32/ia32_syscall.c
@@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$");
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
+#include <security/audit/audit.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -184,7 +185,9 @@ ia32_syscall(struct trapframe frame)
STOPEVENT(p, S_SCE, narg);
+ AUDIT_SYSCALL_ENTER(code, td);
error = (*callp->sy_call)(td, args64);
+ AUDIT_SYSCALL_EXIT(error, td);
}
switch (error) {
OpenPOWER on IntegriCloud