summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2015-08-03 13:41:47 +0000
committered <ed@FreeBSD.org>2015-08-03 13:41:47 +0000
commitb2ca400b88fe784dac7366a03a4bbc52585f027f (patch)
treeb5d9e9c8cd70290b6d489f0020de0d73bfbda976 /sys/kern/kern_exec.c
parentb31c115daa6de83fc575d484bbd4f7114d62b234 (diff)
downloadFreeBSD-src-b2ca400b88fe784dac7366a03a4bbc52585f027f.zip
FreeBSD-src-b2ca400b88fe784dac7366a03a4bbc52585f027f.tar.gz
Add sysent flag to switch to capabilities mode on startup.
CloudABI processes should run in capabilities mode automatically. There is no need to switch manually (e.g., by calling cap_enter()). Add a flag, SV_CAPSICUM, that can be used to call into cap_enter() during execve(). Reviewed by: kib
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 517b689..56207a0 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -562,6 +562,10 @@ interpret:
goto exec_fail_dealloc;
}
+ /* ABI enforces the use of Capsicum. Switch into capabilities mode. */
+ if (SV_PROC_FLAG(p, SV_CAPSICUM))
+ sys_cap_enter(td, NULL);
+
/*
* Copy out strings (args and env) and initialize stack base
*/
OpenPOWER on IntegriCloud