summaryrefslogtreecommitdiffstats
path: root/sys/dev/diskmap.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-11-20 16:06:53 +0000
committerderaadt <deraadt@openbsd.org>2015-11-20 16:06:53 +0000
commit2579b71c0b238735afd8735d695b1f7d8ca1df5e (patch)
treebdd0ee558ec0975e79efb5beb3fa77aad2daf409 /sys/dev/diskmap.c
parentCannot pledge bottom half of setting, because of the ioctl backing (diff)
downloadwireguard-openbsd-2579b71c0b238735afd8735d695b1f7d8ca1df5e.tar.xz
wireguard-openbsd-2579b71c0b238735afd8735d695b1f7d8ca1df5e.zip
Add pledge "disklabel", which allows sysctl kern.rawpartition, a
few disklabel ioctls, and the DIOCMAP ioctl against /dev/diskmap used to translate duid numbers into partitions. This will allow pledging of at least 12 disk/filesystem aware programs; due to the negative impact that diff will wait a bit so everyone has a chance to update their kernels. ok semarie
Diffstat (limited to 'sys/dev/diskmap.c')
-rw-r--r--sys/dev/diskmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c
index 66ed327200d..d17485f35a1 100644
--- a/sys/dev/diskmap.c
+++ b/sys/dev/diskmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskmap.c,v 1.12 2015/08/30 03:09:14 deraadt Exp $ */
+/* $OpenBSD: diskmap.c,v 1.13 2015/11/20 16:06:53 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org>
@@ -36,6 +36,7 @@
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/vnode.h>
+#include <sys/pledge.h>
int
diskmapopen(dev_t dev, int flag, int fmt, struct proc *p)
@@ -88,6 +89,7 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
ndp.ni_dirfd = AT_FDCWD;
ndp.ni_dirp = devname;
ndp.ni_cnd.cn_proc = p;
+ ndp.ni_pledge = PLEDGE_RPATH;
if ((error = vn_open(&ndp, fp->f_flag, 0)) != 0)
goto bad;