From 394ee169ea6eb4dd5c8fa778d1c2769e26e52f01 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 3 Apr 2021 14:04:23 +0200 Subject: Enabled SMAP/SMEP protections --- kernel/features/syscall.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel/features/syscall.c') diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c index 6a64996..b5c08da 100644 --- a/kernel/features/syscall.c +++ b/kernel/features/syscall.c @@ -28,8 +28,8 @@ static void syscall_handler(struct regs *r) break; } case SYS_ALLOC: { - r->eax = (u32)memory_sys_alloc(proc_current()->page_dir, r->ebx, (u32 *)r->ecx, - (u32 *)r->edx, (u8)r->esi); + r->eax = memory_sys_alloc(proc_current()->page_dir, r->ebx, (u32 *)r->ecx, + (u32 *)r->edx, (u8)r->esi); break; } case SYS_FREE: { @@ -102,7 +102,7 @@ static void syscall_handler(struct regs *r) case SYS_BOOT_REBOOT: print("Rebooting...\n"); outb(0x64, 0xfe); - __asm__ volatile("ud2"); + __asm__ volatile("cli\nud2"); break; case SYS_BOOT_SHUTDOWN: print("Shutting down...\n"); @@ -110,7 +110,7 @@ static void syscall_handler(struct regs *r) outw(0x604, 0x2000); outw(0x4004, 0x3400); outb(0x64, 0xfe); - __asm__ volatile("ud2"); + __asm__ volatile("cli\nud2"); break; default: r->eax = -EINVAL; -- cgit v1.2.3