From ab8f7adba1f1684dbafaf8b8d3ce3989bad1d840 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 25 Oct 2015 10:30:58 +0000 Subject: [PATCH] ps(1) needs sysctl KERN_PROC_CWD exposed as well in the pledge "ps" set. hit by czarkoff --- sys/kern/kern_pledge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 1706f922fc5..fd1a9aeb732 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.70 2015/10/25 01:57:09 millert Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.71 2015/10/25 10:30:58 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -896,6 +896,9 @@ pledge_sysctl_check(struct proc *p, int miblen, int *mib, void *new) if (miblen == 6 && /* kern.proc.* */ mib[0] == CTL_KERN && mib[1] == KERN_PROC) return (0); + if (miblen == 3 && /* kern.proc_cwd.* */ + mib[0] == CTL_KERN && mib[1] == KERN_PROC_CWD) + return (0); if (miblen == 2 && /* hw.physmem */ mib[0] == CTL_HW && mib[1] == HW_PHYSMEM64) return (0); -- 2.20.1