From e91d19a58ada036c96ff4431346b98ccc4717381 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 17 Jun 2021 10:11:53 +0200 Subject: [PATCH] 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 --- dlls/ntdll/unix/virtual.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index c268b66f50c..0a4004d2db9 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -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 ); return TRUE; } - - /* 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; - + if (mprotect_exec( base, size, unix_prot )) return FALSE; set_page_vprot( base, size, vprot ); return TRUE; }