File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,19 @@ impl StackRestoreGuard {
44
44
size_with_guard,
45
45
old_stack_limit : get_stack_limit ( ) ,
46
46
} ;
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.
48
48
// There is one guard page below the stack and another above it.
49
49
let above_guard_page = new_stack. add ( page_size) ;
50
50
#[ cfg( not( target_os = "openbsd" ) ) ]
51
51
let result = libc:: mprotect (
52
52
above_guard_page,
53
- size_with_guard - page_size,
53
+ size_with_guard - 2 * page_size,
54
54
libc:: PROT_READ | libc:: PROT_WRITE ,
55
55
) ;
56
56
#[ cfg( target_os = "openbsd" ) ]
57
57
let result = if libc:: mmap (
58
58
above_guard_page,
59
- size_with_guard - page_size,
59
+ size_with_guard - 2 * page_size,
60
60
libc:: PROT_READ | libc:: PROT_WRITE ,
61
61
libc:: MAP_FIXED | libc:: MAP_PRIVATE | libc:: MAP_ANON | libc:: MAP_STACK ,
62
62
-1 ,
You can’t perform that action at this time.
0 commit comments