1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:25:07 +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:
Andreas Kling 2019-12-15 20:11:57 +01:00
parent 39a6d29b39
commit 931e4b7f5e
5 changed files with 7 additions and 3 deletions

View file

@ -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())