diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-05 20:38:02 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-05 20:38:02 +0300 |
| commit | 5b3fbbf8bad230318aded7c5e1ab6cc607724e64 (patch) | |
| tree | f46fc6f8b086095a8c7344a1c92670f4fa071daa /common | |
| parent | 67831847a3fb211784e1d143d472fd86c0e5fab8 (diff) | |
| download | kmi-5b3fbbf8bad230318aded7c5e1ab6cc607724e64.tar.gz kmi-5b3fbbf8bad230318aded7c5e1ab6cc607724e64.zip | |
add check against calling ipc_resp erroneously
Diffstat (limited to 'common')
| -rw-r--r-- | common/uapi/ipc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/uapi/ipc.c b/common/uapi/ipc.c index d71f53c..1596169 100644 --- a/common/uapi/ipc.c +++ b/common/uapi/ipc.c @@ -155,6 +155,11 @@ static struct stack_diff enter_rpc(struct tcb *t, struct sys_ret a) */ static void leave_rpc(struct tcb *t, struct sys_ret a) { + /* if we're not in an rpc, the user messed something up. */ + /** @todo choose or come up with more fitting error value. */ + if (!is_rpc(t)) + return_args(t, SYS_RET1(ERR_MISC)); + vm_t rpc_stack = t->rpc_stack + BASE_PAGE_SIZE; struct call_ctx *ctx = (struct call_ctx *)(rpc_stack) - 1; t->regs = ctx->regs; |
