Fold "malloc" into "stdio" and -- recognizing that no program so far has
authorderaadt <deraadt@openbsd.org>
Sun, 25 Oct 2015 20:39:54 +0000 (20:39 +0000)
committerderaadt <deraadt@openbsd.org>
Sun, 25 Oct 2015 20:39:54 +0000 (20:39 +0000)
commit91bc69b80d8c05b03476ea3b34fefd833b593f98
treee82e9ea63df5cf144fcd9bb1028e37f5eacefe73
parentdaa441c55ce848c4b6b6bf376cb9f62478966306
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
13 files changed:
sys/kern/kern_exec.c
sys/kern/kern_ktrace.c
sys/kern/kern_pledge.c
sys/kern/kern_sig.c
sys/kern/kern_sysctl.c
sys/kern/uipc_syscalls.c
sys/kern/uipc_usrreq.c
sys/kern/vfs_syscalls.c
sys/sys/ktrace.h
sys/sys/pledge.h
sys/sys/proc.h
usr.bin/kdump/kdump.c
usr.bin/ktrace/ktrace.h