diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-02 16:34:38 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-02 16:34:38 +0200 |
| commit | 17fd9daf39cf79ae310c1b7d0eb459802517dc6a (patch) | |
| tree | 1f9061bc489289769d134e97efea805cbf1bf29a /src/uapi/proc.c | |
| parent | 010152de4f19fcb4f1b627123aa27f08deb13e72 (diff) | |
| download | kmi-17fd9daf39cf79ae310c1b7d0eb459802517dc6a.tar.gz kmi-17fd9daf39cf79ae310c1b7d0eb459802517dc6a.zip | |
check spawn exhaustion
Diffstat (limited to 'src/uapi/proc.c')
| -rw-r--r-- | src/uapi/proc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/uapi/proc.c b/src/uapi/proc.c index 51a1252..5eb3013 100644 --- a/src/uapi/proc.c +++ b/src/uapi/proc.c @@ -154,11 +154,15 @@ SYSCALL_DEFINE2(spawn)(struct tcb *t, sys_arg_t bin, sys_arg_t interp) if (!n) return_args1(t, ERR_OOMEM); + /** @todo there's currently a kind of silly thing where create_proc() + * creates a new thread and calls init_uvmem() on it, and now the elf + * loader called from prepare_proc() moves that uvmem aside, calls + * init_uvmem() again and finally destroys the old uvmem (assuming + * everything went as it was supposed to). Might have to rething these + * internal APIs a bit, but for now this ~works~. */ n->notify_id = c->notify_id; if (prepare_proc(n, bin, interp)) { - /* this kills the thread */ - orphanize(t); - unorphanize(t); + destroy_proc(n); return_args1(t, ERR_INVAL); } |
