Diving into /proc/[pid]/mem
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.
Company
Cloudflare
Date published
Oct. 27, 2020
Author(s)
Lennart Espe
Word count
1474
Hacker News points
48
Language
English