[kernel] Only accept invalid handles for optional syscall args

The syscall helpers.h get_handle functions should be returing
j6_err_invalid_arg if the handle they're given is j6_handle_invalid,
unless explicitly set to optional.
This commit is contained in:
Justin C. Miller
2023-02-06 01:13:55 -08:00
parent 8966380ef9
commit 359ee035d8
4 changed files with 29 additions and 16 deletions

View File

@@ -19,7 +19,7 @@ object mailbox : object {
method call [cap:send] {
param tag uint64 [inout]
param subtag uint64 [inout]
param give_handle ref object [inout handle]
param give_handle ref object [optional inout handle]
}
# Respond to a message sent using call, and wait for another
@@ -29,7 +29,7 @@ object mailbox : object {
method respond [cap:receive] {
param tag uint64 [inout]
param subtag uint64 [inout]
param give_handle ref object [inout handle]
param give_handle ref object [optional inout handle]
param reply_tag uint64 [inout]
param flags uint64
}