From 931e4b7f5ec8a5ced69c3789ecdcf0772cbee7ef Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 15 Dec 2019 20:11:57 +0100 Subject: Kernel+SystemMonitor: Prevent userspace access to process ELF image Every process keeps its own ELF executable mapped in memory in case we need to do symbol lookup (for backtraces, etc.) Until now, it was mapped in a way that made it accessible to the program, despite the program not having mapped it itself. I don't really see a need for userspace to have access to this right now, so let's lock things down a little bit. This patch makes it inaccessible to userspace and exposes that fact through /proc/PID/vm (per-region "user_accessible" flag.) --- Kernel/VM/Region.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Kernel/VM/Region.h') diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h index 9092867bc1..eb76b3accb 100644 --- a/Kernel/VM/Region.h +++ b/Kernel/VM/Region.h @@ -57,6 +57,7 @@ public: void set_mmap(bool mmap) { m_mmap = mmap; } bool is_user_accessible() const { return m_user_accessible; } + void set_user_accessible(bool b) { m_user_accessible = b; } PageFaultResponse handle_fault(const PageFault&); -- cgit v1.2.3