From 5ee906eee3ec8f018a35777d72c146c08ad59e80 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Sun, 12 Jul 2026 11:31:34 +0300 Subject: [PATCH] fix: add MAP_SHARED to map_mut_anywhere flags validate_kfmap_flags in kernel proc scheme requires exactly one of MAP_SHARED or MAP_PRIVATE. Without it, shared == private == false, and the check fails with EINVAL. This was the root cause of the fexec_impl crash at step 62 (first PT_LOAD segment mapping). --- redox-rt/src/proc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redox-rt/src/proc.rs b/redox-rt/src/proc.rs index de03a80b94..d24e66f9a8 100644 --- a/redox-rt/src/proc.rs +++ b/redox-rt/src/proc.rs @@ -740,7 +740,7 @@ impl<'a> MmapGuard<'a> { size, offset, address: 0, - flags: PROT_READ | PROT_WRITE, + flags: PROT_READ | PROT_WRITE | MapFlags::MAP_SHARED, }, )?; let slice = unsafe { &mut *this.as_mut_ptr_slice() };