summaryrefslogtreecommitdiff
path: root/sbin/savecore/savecore.c
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2018-09-28 14:03:15 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2018-09-28 14:03:15 +0000
commit21747e167357bcfc6510c7620c4b1140e274e84f (patch)
tree72d1798bd188ec486612bc5a0adf3e46a338b652 /sbin/savecore/savecore.c
parente856515e344fea2c99f1443899c477458a487980 (diff)
add missing unveil(2) of an arbitrary kernel (when -N is used), or _PATH_UNIX by
default, with read permissions. report and fix provided by semarie@ OK deraadt@
Diffstat (limited to 'sbin/savecore/savecore.c')
-rw-r--r--sbin/savecore/savecore.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c
index 8b2a6cf50d0..53257574006 100644
--- a/sbin/savecore/savecore.c
+++ b/sbin/savecore/savecore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: savecore.c,v 1.58 2018/09/24 21:26:38 deraadt Exp $ */
+/* $OpenBSD: savecore.c,v 1.59 2018/09/28 14:03:14 mestre Exp $ */
/* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */
/*-
@@ -175,6 +175,10 @@ main(int argc, char *argv[])
syslog(LOG_ERR, "unveil: %m");
exit(1);
}
+ if (unveil(kernel ? kernel : _PATH_UNIX, "r") == -1) {
+ syslog(LOG_ERR, "unveil: %m");
+ exit(1);
+ }
if (pledge("stdio rpath wpath cpath", NULL) == -1) {
syslog(LOG_ERR, "pledge: %m");
exit(1);