ntdll-Builtin_Prot: Only handle read faults.

This commit is contained in:
Sebastian Lackner
2017-06-19 04:01:59 +02:00
parent 866e79688c
commit 0a16521c7e
6 changed files with 65 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
From 27834dc400a876c75de4dce156f25ce07ec3f78b Mon Sep 17 00:00:00 2001
From 06d43d3d4ee46e7e6f70b43cca3b10cf09a474a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 1 Jun 2017 06:04:53 +0200
Subject: ntdll: Fix holes in ELF mappings.
@@ -10,14 +10,14 @@ Based on a patch by Andrew Wesie.
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 387379a5882..55c15690f70 100644
index 2889e8babc..a6c4ac480f 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1526,6 +1526,12 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack )
if (VIRTUAL_GetUnixProt( *vprot ) & PROT_READ) ret = STATUS_SUCCESS;
else update_shared_data = FALSE;
}
+ else if ((view->protect & VPROT_SYSTEM) && (VIRTUAL_GetUnixProt( *vprot ) & PROT_READ))
+ else if (!err && (view->protect & VPROT_SYSTEM) && (VIRTUAL_GetUnixProt( *vprot ) & PROT_READ))
+ {
+ /* ignore fault if page can be made readable */
+ if (VIRTUAL_SetProt( view, page, page_size, *vprot )) ret = STATUS_SUCCESS;
@@ -27,7 +27,7 @@ index 387379a5882..55c15690f70 100644
{
VIRTUAL_SetProt( view, page, page_size, *vprot & ~VPROT_GUARD );
diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c
index e35a7b694cb..e7af5bc61cc 100644
index e35a7b694c..e7af5bc61c 100644
--- a/dlls/psapi/tests/psapi_main.c
+++ b/dlls/psapi/tests/psapi_main.c
@@ -152,6 +152,7 @@ static void test_EnumProcessModules(void)

View File

@@ -1,2 +1,3 @@
Fixes: Fix holes in ELF mappings
Depends: ntdll-User_Shared_Data
Depends: ntdll-x86_64_ExceptionInformation