File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,19 @@ impl StackRestoreGuard {
4444 size_with_guard,
4545 old_stack_limit : get_stack_limit ( ) ,
4646 } ;
47- // We leave a guard page without read/write access in our allocation.
47+ // We leave two guard pages without read/write access in our allocation.
4848 // There is one guard page below the stack and another above it.
4949 let above_guard_page = new_stack. add ( page_size) ;
5050 #[ cfg( not( target_os = "openbsd" ) ) ]
5151 let result = libc:: mprotect (
5252 above_guard_page,
53- size_with_guard - page_size,
53+ size_with_guard - 2 * page_size,
5454 libc:: PROT_READ | libc:: PROT_WRITE ,
5555 ) ;
5656 #[ cfg( target_os = "openbsd" ) ]
5757 let result = if libc:: mmap (
5858 above_guard_page,
59- size_with_guard - page_size,
59+ size_with_guard - 2 * page_size,
6060 libc:: PROT_READ | libc:: PROT_WRITE ,
6161 libc:: MAP_FIXED | libc:: MAP_PRIVATE | libc:: MAP_ANON | libc:: MAP_STACK ,
6262 -1 ,
You can’t perform that action at this time.
0 commit comments