mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
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.)
This commit is contained in:
@@ -20,6 +20,8 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget(GWidget* parent)
|
||||
pid_vm_fields.empend("amount_resident", "Resident", TextAlignment::CenterRight);
|
||||
pid_vm_fields.empend("Access", TextAlignment::CenterLeft, [](auto& object) {
|
||||
StringBuilder builder;
|
||||
if (!object.get("user_accessible").to_bool())
|
||||
builder.append('K');
|
||||
if (object.get("readable").to_bool())
|
||||
builder.append('R');
|
||||
if (object.get("writable").to_bool())
|
||||
|
||||
Reference in New Issue
Block a user