From ab39c6541afbc295b70ff00b22e7945eca47fa9a Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 10 Jan 2024 14:50:30 +0200 Subject: [PATCH] Kernel: Require keymap loading superuser privileges --- kernel/kernel/Process.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kernel/Process.cpp b/kernel/kernel/Process.cpp index 431dc9f7..da34db89 100644 --- a/kernel/kernel/Process.cpp +++ b/kernel/kernel/Process.cpp @@ -1260,6 +1260,9 @@ namespace Kernel LockGuard _(m_lock); TRY(validate_string_access(path)); + if (!m_credentials.is_superuser()) + return BAN::Error::from_errno(EPERM); + auto absolute_path = TRY(absolute_path_of(path)); TRY(Input::KeyboardLayout::get().load_from_file(absolute_path)); return 0;