[kernel] Let objects inherit caps from superclasses
The main point of this change is to allow "global" capabilities defined on the base object type. The example here is the clone capability on all objects, which governs the ability to clone a handle. Related changes in this commit: - Renamed `kobject` to `object` as far as the syscall interface is concerned. `kobject` is the cname, but j6_cap_kobject_clone feels clunky. - The above change made me realize that the "object <type>" syntax for specifying object references was also clunky, so now it's "ref <type>" - Having to add `.object` on everywhere to access objects in interface.exposes or object.super was cumbersome, so those properties now return object types directly, instead of ObjectRef. - syscall_verify.cpp.cog now generates code to check capabilities on handles if they're specified in the definition, even when not passing an object to the implementation function.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import "objects/kobject.def"
|
||||
import "objects/object.def"
|
||||
|
||||
import "objects/channel.def"
|
||||
import "objects/endpoint.def"
|
||||
@@ -11,14 +11,14 @@ import "objects/vma.def"
|
||||
interface syscalls [syscall] {
|
||||
uid 01d9b6a948961097
|
||||
|
||||
expose object system
|
||||
expose object kobject
|
||||
expose object event
|
||||
expose object process
|
||||
expose object thread
|
||||
expose object channel
|
||||
expose object endpoint
|
||||
expose object vma
|
||||
expose ref object
|
||||
expose ref system
|
||||
expose ref event
|
||||
expose ref process
|
||||
expose ref thread
|
||||
expose ref channel
|
||||
expose ref endpoint
|
||||
expose ref vma
|
||||
|
||||
# Simple no-op syscall for testing
|
||||
function noop
|
||||
@@ -32,14 +32,14 @@ interface syscalls [syscall] {
|
||||
# supplied list is not big enough, will set the size
|
||||
# needed in `size` and return j6_err_insufficient
|
||||
function handle_list {
|
||||
param handles object kobject [list inout optional] # A list of handles to be filled
|
||||
param handles ref object [list inout optional] # A list of handles to be filled
|
||||
}
|
||||
|
||||
# Create a clone of an existing handle, possibly with
|
||||
# some capabilities masked out.
|
||||
function handle_clone {
|
||||
param handle object kobject [handle] # The handle to clone
|
||||
param clone object kobject [out] # The new handle
|
||||
param mask uint32 # The capability bitmask
|
||||
param orig ref object [handle cap:clone] # The handle to clone
|
||||
param clone ref object [out] # The new handle
|
||||
param mask uint32 # The capability bitmask
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user