ntdll: Remove special case for setting permissions on stack pages.

We are running on the kernel stack at this point.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-06-17 10:11:53 +02:00
parent 7b4ca95ab6
commit e91d19a58a
1 changed files with 1 additions and 15 deletions

View File

@ -1675,21 +1675,7 @@ static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vpr
mprotect_range( base, size, 0, 0 ); mprotect_range( base, size, 0, 0 );
return TRUE; return TRUE;
} }
if (mprotect_exec( base, size, unix_prot )) return FALSE;
/* if setting stack guard pages, store the permissions first, as the guard may be
* triggered at any point after mprotect and change the permissions again */
if ((vprot & VPROT_GUARD) &&
(base >= NtCurrentTeb()->DeallocationStack) &&
(base < NtCurrentTeb()->Tib.StackBase))
{
set_page_vprot( base, size, vprot );
mprotect( base, size, unix_prot );
return TRUE;
}
if (mprotect_exec( base, size, unix_prot )) /* FIXME: last error */
return FALSE;
set_page_vprot( base, size, vprot ); set_page_vprot( base, size, vprot );
return TRUE; return TRUE;
} }