diff options
author | 2015-10-25 20:39:54 +0000 | |
---|---|---|
committer | 2015-10-25 20:39:54 +0000 | |
commit | 91bc69b80d8c05b03476ea3b34fefd833b593f98 (patch) | |
tree | e82e9ea63df5cf144fcd9bb1028e37f5eacefe73 /sys/kern/kern_exec.c | |
parent | pledge "route" no longer needed for if_indextoname & if_nametoindex (diff) | |
download | wireguard-openbsd-91bc69b80d8c05b03476ea3b34fefd833b593f98.tar.xz wireguard-openbsd-91bc69b80d8c05b03476ea3b34fefd833b593f98.zip |
Fold "malloc" into "stdio" and -- recognizing that no program so far has
used less than "stdio" -- include all the "self" operations. Instead of
different defines, use regular PLEDGE_* in the "p_pledgenote" variable
(which indicates the operation subtype a system call is performing). Many
checks before easier to understand. p_pledgenote can often be passed
directly to ktrace, so that kdump says:
15565 test CALL pledge(0xa9a3f804c51,0)
15565 test STRU pledge request="stdio"
15565 test RET pledge 0
15565 test CALL open(0xa9a3f804c57,0x2<O_RDWR>)
15565 test NAMI "/tmp/testfile"
15565 test PLDG open, "wpath", errno 1 Operation not permitted
with help from semarie, ok guenther
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 8b3f0e5e50d..168bdd12f9c 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.169 2015/10/10 14:46:15 deraadt Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.170 2015/10/25 20:39:54 deraadt Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -280,7 +280,7 @@ sys_execve(struct proc *p, void *v, register_t *retval) * Mark this process as "leave me alone, I'm execing". */ atomic_setbits_int(&pr->ps_flags, PS_INEXEC); - p->p_pledgenote = TMN_XPATH; + p->p_pledgenote = PLEDGE_EXEC; #if NSYSTRACE > 0 if (ISSET(p->p_flag, P_SYSTRACE)) { |