From 0a4a77a56be1eab555edd16499c4fbcff81636aa Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Fri, 29 May 2026 14:25:37 +0300 Subject: [PATCH] P27: add missing proc.rs guard.caps derivation from euid The capability bitmask patch was missing the critical proc.rs hunk that derives caps from euid when procmgr writes ProcSchemeAttrs to a child context. Without this, all child processes had caps=0, causing EACCES on dup("create-scheme") and crashing boot. Fix: in ContextHandle::Attr kwrite path, after setting euid/egid/pid/prio, set guard.caps = CAP_ALL when euid==0, else 0. --- local/patches/kernel/P27-capability-bitmask.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/local/patches/kernel/P27-capability-bitmask.patch b/local/patches/kernel/P27-capability-bitmask.patch index 0612955318..4afc058544 100644 --- a/local/patches/kernel/P27-capability-bitmask.patch +++ b/local/patches/kernel/P27-capability-bitmask.patch @@ -129,3 +129,12 @@ index 86aabc2..4af65a3 100644 +++ b/src/startup/mod.rs @@ -190,0 +191 @@ pub(crate) fn kmain(bootstrap: Bootstrap) -> ! { + context.caps = crate::scheme::caps::CAP_ALL; +diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs +--- a/src/scheme/proc.rs ++++ b/src/scheme/proc.rs +@@ -1275,0 +1276,5 @@ impl ContextHandle { ++ guard.caps = if info.euid == 0 { ++ crate::scheme::caps::CAP_ALL ++ } else { ++ 0 ++ };