From 9cac205d672415b4eee090684452024389cc400b Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 13 Jan 2020 01:26:20 -0800 Subject: [PATCH] Kernel: Fix SMAP in setkeymap syscall It looks like setkeymap was missed when the SMAP functionality was introduced. Disable SMAP only in the scope where we actually read the usermode addresses. --- Kernel/Process.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 044b2b827c..8b897997f6 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -3955,6 +3955,7 @@ int Process::sys$setkeymap(const Syscall::SC_setkeymap_params* params) if (!validate_read(altgr_map, 0x80)) return -EFAULT; + SmapDisabler disabler; KeyboardDevice::the().set_maps(map, shift_map, alt_map, altgr_map); return 0; }