Skip to content

Fix procfs on /proc/self with user namespaces#859

Merged
sunfishcode merged 5 commits intomainfrom
sunfishcode/pid-namespace
Sep 29, 2023
Merged

Fix procfs on /proc/self with user namespaces#859
sunfishcode merged 5 commits intomainfrom
sunfishcode/pid-namespace

Conversation

@sunfishcode
Copy link
Member

Use readlink on the /proc/self symlink instead of getpid, so that we get the pid relative to the procfs's pid namespace rather than the process' pid namespace.

Fixes #854.

Use `readlink` on the /proc/self symlink instead of `getpid`, so
that we get the pid relative to the procfs's pid namespace rather
than the process' pid namespace.

Fixes #854.
@sunfishcode sunfishcode force-pushed the sunfishcode/pid-namespace branch from f6435a6 to 60b016d Compare September 29, 2023 05:59
@sunfishcode sunfishcode merged commit 69319a3 into main Sep 29, 2023
@sunfishcode sunfishcode deleted the sunfishcode/pid-namespace branch September 29, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proc_self_*() functions can open the wrong process's files

1 participant