summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-06-21 13:41:32 +0000
committerkib <kib@FreeBSD.org>2009-06-21 13:41:32 +0000
commit171c37f865ca934d583ae77a7edb3e6818a364bb (patch)
tree548a61c5fc4bd14c03a515783550b0e6868c9c0b /sys/kern/kern_sig.c
parentb91bec2bd9b4fd4d1c040ca5254dc4b95c6c9ee1 (diff)
downloadFreeBSD-src-171c37f865ca934d583ae77a7edb3e6818a364bb.zip
FreeBSD-src-171c37f865ca934d583ae77a7edb3e6818a364bb.tar.gz
Add another flags argument to vn_open_cred. Use it to specify that some
vn_open_cred invocations shall not audit namei path. In particular, specify VN_OPEN_NOAUDIT for dotdot lookup performed by default implementation of vop_vptocnp, and for the open done for core file. vn_fullpath is called from the audit code, and vn_open there need to disable audit to avoid infinite recursion. Core file is created on return to user mode, that, in particular, happens during syscall return. The creation of the core file is audited by direct calls, and we do not want to overwrite audit information for syscall. Reported, reviewed and tested by: rwatson
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 5c1d553..57afc23 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2940,7 +2940,8 @@ coredump(struct thread *td)
restart:
NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, name, td);
flags = O_CREAT | FWRITE | O_NOFOLLOW;
- error = vn_open(&nd, &flags, S_IRUSR | S_IWUSR, NULL);
+ error = vn_open_cred(&nd, &flags, S_IRUSR | S_IWUSR, VN_OPEN_NOAUDIT,
+ NULL, NULL);
if (error) {
#ifdef AUDIT
audit_proc_coredump(td, name, error);
OpenPOWER on IntegriCloud