diff options
author | Ed Schouten <ed@FreeBSD.org> | 2015-07-31 10:21:58 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2015-07-31 10:21:58 +0000 |
commit | 367a13f905874f6ad0a5f78cb88a4923cfe86e5e (patch) | |
tree | 3af076b2b6a63198d599f44bbb24b732d181ad1e /sys/kern/init_main.c | |
parent | a2b3dfad08f6b785cbadb3b3ba35e4c0e84ba29e (diff) | |
download | src-367a13f905874f6ad0a5f78cb88a4923cfe86e5e.tar.gz src-367a13f905874f6ad0a5f78cb88a4923cfe86e5e.zip |
Limit rights on process descriptors.
On CloudABI, the rights bits returned by cap_rights_get() match up with
the operations that you can actually perform on the file descriptor.
Limiting the rights is good, because it makes it easier to get uniform
behaviour across different operating systems. If process descriptors on
FreeBSD would suddenly gain support for any new file operation, this
wouldn't become exposed to CloudABI processes without first extending
the rights.
Extend fork1() to gain a 'struct filecaps' argument that allows you to
construct process descriptors with custom rights. Use this in
cloudabi_sys_proc_fork() to limit the rights to just fstat() and
pdwait().
Obtained from: https://github.com/NuxiNL/freebsd
Notes
Notes:
svn path=/head/; revision=286122
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index a362d00fbfdf..efb7317c0e09 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -831,7 +831,7 @@ create_init(const void *udata __unused) int error; error = fork1(&thread0, RFFDG | RFPROC | RFSTOPPED, 0, &initproc, - NULL, 0); + NULL, 0, NULL); if (error) panic("cannot fork init: %d\n", error); KASSERT(initproc->p_pid == 1, ("create_init: initproc->p_pid != 1")); |