summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorwsalamon <wsalamon@FreeBSD.org>2006-02-05 23:57:32 +0000
committerwsalamon <wsalamon@FreeBSD.org>2006-02-05 23:57:32 +0000
commit645740538d7ab2cfbd5a29d9edaf08a1abd9371b (patch)
treea4c402a57ad0930255edb784300bb342757d6f13 /sys/kern/kern_descrip.c
parente04cb6becdf3fcdc1ce1c160ebf3c995dd8b9f9b (diff)
downloadFreeBSD-src-645740538d7ab2cfbd5a29d9edaf08a1abd9371b.zip
FreeBSD-src-645740538d7ab2cfbd5a29d9edaf08a1abd9371b.tar.gz
Add auditing of arguments to the close() and fstat() system calls. Much more
argument auditing yet to come, for remaining system calls in this file. Obtained from: TrustedBSD Project Approved by: rwatson (mentor)
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 7cc2c12..f84d348 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$");
#include <sys/unistd.h>
#include <sys/vnode.h>
+#include <security/audit/audit.h>
+
#include <vm/uma.h>
#include <ddb/ddb.h>
@@ -980,6 +982,9 @@ close(td, uap)
error = 0;
holdleaders = 0;
fdp = td->td_proc->p_fd;
+
+ AUDIT_SYSCLOSE(td, fd);
+
FILEDESC_LOCK(fdp);
if ((unsigned)fd >= fdp->fd_nfiles ||
(fp = fdp->fd_ofiles[fd]) == NULL) {
@@ -1085,8 +1090,13 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp)
struct file *fp;
int error;
+ AUDIT_ARG(fd, fd);
+
if ((error = fget(td, fd, &fp)) != 0)
return (error);
+
+ AUDIT_ARG(file, td->td_proc, fp);
+
error = fo_stat(fp, sbp, td->td_ucred, td);
fdrop(fp, td);
return (error);
OpenPOWER on IntegriCloud