diff options
| author | 2015-08-22 20:18:49 +0000 | |
|---|---|---|
| committer | 2015-08-22 20:18:49 +0000 | |
| commit | 430c0dbabc0b49c3b13ba68ed9204b6b4b0d98c3 (patch) | |
| tree | 322a56a126346a376ff50a939e8742555c6ea092 /sys/kern/kern_exit.c | |
| parent | Explicitly list the symbols permitted to be exported by libc. (diff) | |
| download | wireguard-openbsd-430c0dbabc0b49c3b13ba68ed9204b6b4b0d98c3.tar.xz wireguard-openbsd-430c0dbabc0b49c3b13ba68ed9204b6b4b0d98c3.zip | |
Move to tame(int flags, char *paths[]) API/ABI.
The pathlist is a whitelist of dirs and files; anything else returns ENOENT.
Recommendation is to use a narrowly defined list. Also add TAME_FATTR, which
permits explicit change operations against "struct stat" fields. Some
other TAME_ flags are refined slightly.
Not cranking libc now, since nothing commited in base uses this and the
timing is uncomfortable for others. Discussed with many; thanks for a
few bug fixes from semarie, doug, guenther.
ok guenther
Diffstat (limited to 'sys/kern/kern_exit.c')
| -rw-r--r-- | sys/kern/kern_exit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index ab9b157fc09..7ee0872bd72 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.149 2015/03/14 03:38:50 jsg Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.150 2015/08/22 20:18:49 deraadt Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -649,6 +649,16 @@ process_zap(struct process *pr) */ (void)chgproccnt(pr->ps_ucred->cr_ruid, -1); + if (pr->ps_tamepaths && --pr->ps_tamepaths->wl_ref == 0) { + struct whitepaths *wl = pr->ps_tamepaths; + int i; + + for (i = 0; i < wl->wl_count; i++) + free(wl->wl_paths[i].name, M_TEMP, wl->wl_paths[i].len); + free(wl, M_TEMP, wl->wl_size); + } + pr->ps_tamepaths = NULL; + /* * Release reference to text vnode */ |
