From 7716e9e9a7611ac6973eaebcda833f3795e0b664 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 28 Oct 2015 11:16:24 +0000 Subject: Though sys_ktrace is not yet pledge allowed, prepare by setting p_pledgenote as required. XXX open question to guenther regarding FREAD to vnopen() / vnclose() --- sys/kern/kern_ktrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index e1727956af9..7d824781f30 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.81 2015/10/25 20:39:54 deraadt Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.82 2015/10/28 11:16:23 deraadt Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -446,7 +446,7 @@ sys_ktrace(struct proc *p, void *v, register_t *retval) * an operation which requires a file argument. */ cred = p->p_ucred; - p->p_pledgenote = PLEDGE_CPATH; + p->p_pledgenote = PLEDGE_CPATH | PLEDGE_WPATH; NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, fname), p); if ((error = vn_open(&nd, FREAD|FWRITE|O_NOFOLLOW, 0)) != 0) -- cgit v1.2.3