# HG changeset patch # User Paul Boddie # Date 1709421161 -3600 # Node ID e96c7cbee506769de204b23a97b72a70c6940b68 # Parent 5d590f2cc5894ad00980ce053817dbde7053d16d Introduced barrier pages between the UTCB region and each of the stacks. diff -r 5d590f2cc589 -r e96c7cbee506 libexec/lib/src/process_creating.cc --- a/libexec/lib/src/process_creating.cc Sat Mar 02 23:51:22 2024 +0100 +++ b/libexec/lib/src/process_creating.cc Sun Mar 03 00:12:41 2024 +0100 @@ -59,7 +59,11 @@ if (err) return err; - _rm_stack = new ExplicitSegment(Utcb_area_start - initial_stack_size, initial_stack_size, L4_FPAGE_RW); + /* Introduce a page as a barrier between the UTCB and the stack. */ + + _rm_stack = new ExplicitSegment(Utcb_area_start - L4_PAGESIZE - + initial_stack_size, initial_stack_size, L4_FPAGE_RW); + return _rm_stack->allocate(true); } @@ -74,7 +78,12 @@ if (err) return err; - _program_stack = new ExplicitSegment(Utcb_area_start - initial_stack_size * 2, initial_stack_size, L4_FPAGE_RW); + /* Introduce a page as a barrier between the program stack and the region + mapper stack. */ + + _program_stack = new ExplicitSegment(Utcb_area_start - L4_PAGESIZE * 2 - + initial_stack_size * 2, initial_stack_size, L4_FPAGE_RW); + return _program_stack->allocate(true); }