Home / Companies / Cloudflare / Blog / Post Details
Content Deep Dive

Diving into /proc/[pid]/mem

Blog post from Cloudflare

Post Details
Company
Date Published
Author
Lennart Espe
Word Count
1,474
Language
English
Hacker News Points
48
Summary

The author describes their experience working on implementing /proc/self/mem file in gVisor, a Linux container runtime sandbox. They explain how stack unwinding code is often run in unusual contexts and requires access to debug symbols for proper functioning. However, inside gVisor's sandbox, the entire /proc/self/mem file was missing due to its careful reimplementation of Linux kernel interfaces. The author delves into the details of how /proc/[pid]/mem works in the Linux kernel and how it can be implemented in Sentry's VFS. They also discuss access checks, reading from the file, and how it works in gVisor. Finally, they successfully implement a useful stack trace for their project.