You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against eb5c1872540a71ebef4703387c11c414516233f4.
This commit is contained in:
@@ -1,35 +1,39 @@
|
||||
From 67ecb071f690c5188777b495dbd3d77916be1ee4 Mon Sep 17 00:00:00 2001
|
||||
From 75af51bc0f3d02eeb1d4e243190db9a4813cb11f 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. (v2)
|
||||
|
||||
Based on a patch by Andrew Wesie.
|
||||
---
|
||||
dlls/ntdll/virtual.c | 10 ++++++++++
|
||||
dlls/ntdll/virtual.c | 14 ++++++++++++++
|
||||
dlls/psapi/tests/psapi_main.c | 14 +++++++++++++-
|
||||
2 files changed, 23 insertions(+), 1 deletion(-)
|
||||
2 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
|
||||
index 2889e8babc3..c73d2998703 100644
|
||||
index 1fa9fd925a1..56a384448c4 100644
|
||||
--- a/dlls/ntdll/virtual.c
|
||||
+++ b/dlls/ntdll/virtual.c
|
||||
@@ -1526,6 +1526,16 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack )
|
||||
if (VIRTUAL_GetUnixProt( *vprot ) & PROT_READ) ret = STATUS_SUCCESS;
|
||||
@@ -1670,6 +1670,20 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack )
|
||||
if (VIRTUAL_GetUnixProt( get_page_vprot( view, page )) & PROT_READ) ret = STATUS_SUCCESS;
|
||||
else update_shared_data = FALSE;
|
||||
}
|
||||
+ else if (!err && (view->protect & VPROT_SYSTEM) && (VIRTUAL_GetUnixProt( *vprot ) & PROT_READ))
|
||||
+ else if (!err && (view->protect & VPROT_SYSTEM) && (VIRTUAL_GetUnixProt( vprot ) & PROT_READ))
|
||||
+ {
|
||||
+ int unix_prot = VIRTUAL_GetUnixProt( *vprot );
|
||||
+ int unix_prot = VIRTUAL_GetUnixProt( vprot );
|
||||
+ unsigned char vec;
|
||||
+
|
||||
+ if (!VIRTUAL_SetProt( view, page, page_size, *vprot )) *vprot &= ~(VPROT_READ | VPROT_EXEC);
|
||||
+ else if (!mincore( page, page_size, &vec ) && (vec & 1)) ret = STATUS_SUCCESS;
|
||||
+ else if (wine_anon_mmap( page, page_size, unix_prot, MAP_FIXED ) != page) *vprot &= ~(VPROT_READ | VPROT_EXEC);
|
||||
+ else ret = STATUS_SUCCESS;
|
||||
+ if (!VIRTUAL_SetProt( view, page, page_size, vprot ))
|
||||
+ set_page_vprot_bits( view, page, page_size, 0, VPROT_READ | VPROT_EXEC );
|
||||
+ else if (!mincore( page, page_size, &vec ) && (vec & 1))
|
||||
+ ret = STATUS_SUCCESS;
|
||||
+ else if (wine_anon_mmap( page, page_size, unix_prot, MAP_FIXED ) != page)
|
||||
+ set_page_vprot_bits( view, page, page_size, 0, VPROT_READ | VPROT_EXEC );
|
||||
+ else
|
||||
+ ret = STATUS_SUCCESS;
|
||||
+ }
|
||||
if (!on_signal_stack && (*vprot & VPROT_GUARD))
|
||||
if (!on_signal_stack && (vprot & VPROT_GUARD))
|
||||
{
|
||||
VIRTUAL_SetProt( view, page, page_size, *vprot & ~VPROT_GUARD );
|
||||
set_page_vprot_bits( view, page, page_size, 0, VPROT_GUARD );
|
||||
diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c
|
||||
index e35a7b694cb..e7af5bc61cc 100644
|
||||
--- a/dlls/psapi/tests/psapi_main.c
|
||||
@@ -66,5 +70,5 @@ index e35a7b694cb..e7af5bc61cc 100644
|
||||
|
||||
static BOOL check_with_margin(SIZE_T perf, SIZE_T sysperf, int margin)
|
||||
--
|
||||
2.13.1
|
||||
2.14.1
|
||||
|
||||
|
Reference in New Issue
Block a user