diff options
author | dzwdz | 2023-01-25 01:02:04 +0100 |
---|---|---|
committer | dzwdz | 2023-01-25 01:04:49 +0100 |
commit | 2a2fc4dffe0117ce874a6cf1dcc34321ed8add77 (patch) | |
tree | af1e24f72241dbbff97797b9e186f7d27b5b54b4 /src/kernel/proc.c | |
parent | 52e7fe3c679469032e77a5ca4adf19618ba1201b (diff) |
kernel/virt: replace the virt_cpy api with a more foolproof one
Diffstat (limited to 'src/kernel/proc.c')
-rwxr-xr-x | src/kernel/proc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c index b49b645..109316e 100755 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -163,6 +163,7 @@ void process_kill(struct process *p, int ret) { process_handle_close(p, hid); kfree(p->_handles); } + p->_handles = NULL; vfs_mount_remref(p->mount); p->mount = NULL; @@ -187,6 +188,7 @@ void process_kill(struct process *p, int ret) { if (unref(p->pages_refcount)) { pagedir_free(p->pages); } + p->pages = NULL; } if (p->state == PS_DYING) { @@ -284,7 +286,7 @@ void process_intr(struct process *p) { void __user *sp = p->regs.rsp - 128 - sizeof(d); d.ip = (void __user *)p->regs.rcx; d.sp = p->regs.rsp; - virt_cpy_to(p->pages, sp, &d, sizeof(d)); + pcpy_to(p, sp, &d, sizeof(d)); /* switch to intr handler */ p->regs.rcx = (uint64_t)p->intr_fn; |