summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2019-10-06 16:24:14 +0000
committerbeck <beck@openbsd.org>2019-10-06 16:24:14 +0000
commitc062619918232778445db758dcef4896fb2074f1 (patch)
tree284c9b250a09d823c925f4e68d227cfadbc50d9d /sys/kern/kern_sig.c
parentAdd support for i2c clock. (diff)
downloadwireguard-openbsd-c062619918232778445db758dcef4896fb2074f1.tar.xz
wireguard-openbsd-c062619918232778445db758dcef4896fb2074f1.zip
Fix vn_open to require an op of 0, and 0 or KERNELPATH only as flags.
sweep tree to correct NDIINT op and flags ahead of time. document the requirement. This allows KERNELPATH to be used to bypass unveil for crash dumps with nosuidcoredump=2 or 3 ok visa@ deraadt@ florian@
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index ccfec90fb38..2b93e41fac7 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.234 2019/10/03 13:58:59 deraadt Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.235 2019/10/06 16:24:14 beck Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1593,7 +1593,8 @@ coredump(struct proc *p)
cred->cr_gid = 0;
}
- NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, p);
+ /* incrash should be 0 or KERNELPATH only */
+ NDINIT(&nd, 0, incrash, UIO_SYSSPACE, name, p);
error = vn_open(&nd, O_CREAT | FWRITE | O_NOFOLLOW | O_NONBLOCK,
S_IRUSR | S_IWUSR);