]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
security: harden /proc with access controls and hidepid (H2)
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 00:50:48 +0000 (21:50 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 00:50:48 +0000 (21:50 -0300)
commita11cee289addcbfc546eef3434313f9d9d321fc8
treecc17b0845d352fd30c3fd425fc65d1c10a0a695b
parent15b842115f3b08027e214814b15e3f4a270476ef
security: harden /proc with access controls and hidepid (H2)

- Protect /proc/dmesg: root-only access (euid == 0)
- Protect /proc/cmdline: root-only access (euid == 0)
- Implement hidepid mechanism with g_proc_hidepid global:
  - 0 = visible to all (default)
  - 1 = invisible to non-root, except own process (current default)
  - 2 = invisible to non-root, including own process
- Redact addresses in /proc/<pid>/maps for non-root users:
  - Show 0 instead of actual heap/brk/mmap addresses
  - Applies even to own process for security
- Update proc_root_readdir to respect hidepid for PID listing
- Update proc_root_finddir to respect hidepid for direct PID access

Validation:
- make -j12: PASS
- make test-host: PASS (111/111)
- make test SMOKE_SMP=4: PASS (127/127)
- make test-battery: PASS (153/153)
- make analyzer: PASS

Addresses H2 from docs/URGENT_SECURITY_STATUS_2026-06-09.md
src/kernel/procfs.c