From b988b821372466ed58eb1d2116bcbb158f70346c Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 24 Aug 2021 19:05:46 +0200 Subject: switch to using user_ptr for pointers coming from userland this avoid accidental dereferences, and now it's easy to tell apart which pointers are safe to directly read and which aren't. cons: - const is completely discarded --- src/kernel/proc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 87fed14..6de270b 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -11,7 +11,7 @@ enum process_state { }; struct process { - void *stack_top; + user_ptr stack_top; struct pagedir *pages; struct registers regs; enum process_state state; @@ -25,7 +25,7 @@ struct process { // meaning changes depending on the state // PS_DEAD - death message // PS_WAITS4CHILDDEATH - buffer for said message - void *saved_addr; + user_ptr saved_addr; size_t saved_len; struct vfs_mount *mount; -- cgit v1.2.3