ptrace and most proc files should be inaccessible to users if binary is not readable
Open
area: filesystem
exported
priority: p3
revived
type: bug
type: cleanup
- Dominant language
- Go
- Stars
- 19.3k
- Forks
- 2k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 264
Description
Calling execve on a binary with execute permissions but no read permissions is allowed. However, the resulting task is marked non-dumpable[1] by the kernel.
This affects __ptrace_may_access[2], which enforces access by ptrace and to many proc files.
Basically, execute-no-read binaries are a subset of typical setuid binaries.
[1] https://elixir.bootlin.com/linux/v5.0.4/source/fs/exec.c#L1316
[2] https://elixir.bootlin.com/linux/v5.0.4/source/kernel/ptrace.c#L327
Contributor guide
Assessment
This issue has not been assessed yet.