process: okay don't mark stack protectors nx...

This commit is contained in:
K. Lange 2021-06-01 23:29:04 +09:00
parent f52e4b8f3d
commit 0913598bb0
2 changed files with 4 additions and 4 deletions

View File

@ -330,7 +330,7 @@ process_t * spawn_kidle(int bsp) {
idle->image.stack = (uintptr_t)valloc(KERNEL_STACK_SIZE)+ KERNEL_STACK_SIZE; idle->image.stack = (uintptr_t)valloc(KERNEL_STACK_SIZE)+ KERNEL_STACK_SIZE;
mmu_frame_allocate( mmu_frame_allocate(
mmu_get_page(idle->image.stack - KERNEL_STACK_SIZE, 0), mmu_get_page(idle->image.stack - KERNEL_STACK_SIZE, 0),
MMU_FLAG_KERNEL | MMU_FLAG_NOEXECUTE); MMU_FLAG_KERNEL);
/* TODO arch_initialize_context(uintptr_t) ? */ /* TODO arch_initialize_context(uintptr_t) ? */
idle->thread.context.ip = bsp ? (uintptr_t)&_kidle : (uintptr_t)&_kburn; idle->thread.context.ip = bsp ? (uintptr_t)&_kidle : (uintptr_t)&_kburn;
@ -383,7 +383,7 @@ process_t * spawn_init(void) {
init->image.stack = (uintptr_t)valloc(KERNEL_STACK_SIZE) + KERNEL_STACK_SIZE; init->image.stack = (uintptr_t)valloc(KERNEL_STACK_SIZE) + KERNEL_STACK_SIZE;
mmu_frame_allocate( mmu_frame_allocate(
mmu_get_page(init->image.stack - KERNEL_STACK_SIZE, 0), mmu_get_page(init->image.stack - KERNEL_STACK_SIZE, 0),
MMU_FLAG_KERNEL | MMU_FLAG_NOEXECUTE); MMU_FLAG_KERNEL);
init->image.shm_heap = 0x200000000; /* That's 8GiB? That should work fine... */ init->image.shm_heap = 0x200000000; /* That's 8GiB? That should work fine... */
init->flags = PROC_FLAG_STARTED | PROC_FLAG_RUNNING; init->flags = PROC_FLAG_STARTED | PROC_FLAG_RUNNING;
@ -438,7 +438,7 @@ process_t * spawn_process(volatile process_t * parent, int flags) {
proc->image.stack = (uintptr_t)valloc(KERNEL_STACK_SIZE) + KERNEL_STACK_SIZE; proc->image.stack = (uintptr_t)valloc(KERNEL_STACK_SIZE) + KERNEL_STACK_SIZE;
mmu_frame_allocate( mmu_frame_allocate(
mmu_get_page(proc->image.stack - KERNEL_STACK_SIZE, 0), mmu_get_page(proc->image.stack - KERNEL_STACK_SIZE, 0),
MMU_FLAG_KERNEL | MMU_FLAG_NOEXECUTE); MMU_FLAG_KERNEL);
proc->image.shm_heap = 0x200000000; /* FIXME this should be a macro def */ proc->image.shm_heap = 0x200000000; /* FIXME this should be a macro def */
if (flags & PROC_REUSE_FDS) { if (flags & PROC_REUSE_FDS) {

View File

@ -152,7 +152,7 @@ void fix_signal_stacks(void) {
if (!p->signal_kstack) { if (!p->signal_kstack) {
printf("Cannot restore signal stack for pid=%d - unset?\n", p->id); printf("Cannot restore signal stack for pid=%d - unset?\n", p->id);
} else { } else {
memcpy((void *)(p->image.stack - KERNEL_STACK_SIZE), p->signal_kstack, KERNEL_STACK_SIZE); memcpy((char *)(p->image.stack - KERNEL_STACK_SIZE + 0x1000), p->signal_kstack + 0x1000, KERNEL_STACK_SIZE - 0x1000);
free(p->signal_kstack); free(p->signal_kstack);
p->signal_kstack = NULL; p->signal_kstack = NULL;
} }