summaryrefslogtreecommitdiff
path: root/sys/kern/kern_pledge.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2019-05-13 22:55:28 +0000
committerBob Beck <beck@cvs.openbsd.org>2019-05-13 22:55:28 +0000
commit0215314fb9f62f0109926d50f4579463d7fd4484 (patch)
treecd23070c4494c084a95b86f9890ed659d764ea97 /sys/kern/kern_pledge.c
parent3c556fa41d41f2f348bfa95db84e9e95458dd36b (diff)
Add a kernel implementation of realpath() as __realpath().
We want this so that we can stop allowing readlink() on traversed vnodes in unveil(). This includes all the kernel side and the system call. This is not yet used in libc for realpath, so nothing calls this yet. The libc wrapper will be committed later. Testing by many, and ports build by naddy@ ok deraadt@
Diffstat (limited to 'sys/kern/kern_pledge.c')
-rw-r--r--sys/kern/kern_pledge.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c
index 04ade838271..6c68e592122 100644
--- a/sys/kern/kern_pledge.c
+++ b/sys/kern/kern_pledge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_pledge.c,v 1.251 2019/02/14 15:41:47 florian Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.252 2019/05/13 22:55:27 beck Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -253,6 +253,7 @@ const uint64_t pledge_syscalls[SYS_MAXSYSCALL] = {
[SYS_stat] = PLEDGE_STDIO,
[SYS_access] = PLEDGE_STDIO,
[SYS_readlink] = PLEDGE_STDIO,
+ [SYS___realpath] = PLEDGE_STDIO, /* XXX Fix me Theo! Fix me! */
[SYS_adjtime] = PLEDGE_STDIO, /* setting requires "settime" */
[SYS_adjfreq] = PLEDGE_SETTIME,