https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ddc66f224d96fb481aa8…
commit 4ddc66f224d96fb481aa8c1cf9a223b94d631e55
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu May 27 19:17:13 2021 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon Jun 7 17:04:18 2021 +0200
[NTOS:MM] Make MI_MAKE_HARDWARE_PTE_KERNEL actually respect the protection it is given
This one would set a page as writable & dirty even if MM_READONLY was passed
CORE-17587
---
ntoskrnl/mm/ARM3/miarm.h | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/miarm.h b/ntoskrnl/mm/ARM3/miarm.h
index 730acdd8bf1..a784d08e15f 100644
--- a/ntoskrnl/mm/ARM3/miarm.h
+++ b/ntoskrnl/mm/ARM3/miarm.h
@@ -790,12 +790,23 @@ MI_MAKE_HARDWARE_PTE_KERNEL(IN PMMPTE NewPte,
ASSERT(!MI_IS_SESSION_PTE(MappingPte));
ASSERT((MappingPte < (PMMPTE)PDE_BASE) || (MappingPte > (PMMPTE)PDE_TOP));
+ /* Check that we are not setting valid a page that should not be */
+ ASSERT(ProtectionMask & MM_PROTECT_ACCESS);
+ ASSERT((ProtectionMask & MM_GUARDPAGE) == 0);
+
/* Start fresh */
- *NewPte = ValidKernelPte;
+ NewPte->u.Long = 0;
/* Set the protection and page */
NewPte->u.Hard.PageFrameNumber = PageFrameNumber;
NewPte->u.Long |= MmProtectToPteMask[ProtectionMask];
+
+ /* Make this valid & global */
+#ifdef _GLOBAL_PAGES_ARE_AWESOME_
+ if (KeFeatureBits & KF_GLOBAL_PAGE)
+ NewPte->u.Hard.Global = 1;
+#endif
+ NewPte->u.Hard.Valid = 1;
}
//
@@ -808,6 +819,10 @@ MI_MAKE_HARDWARE_PTE(IN PMMPTE NewPte,
IN ULONG_PTR ProtectionMask,
IN PFN_NUMBER PageFrameNumber)
{
+ /* Check that we are not setting valid a page that should not be */
+ ASSERT(ProtectionMask & MM_PROTECT_ACCESS);
+ ASSERT((ProtectionMask & MM_GUARDPAGE) == 0);
+
/* Set the protection and page */
NewPte->u.Long = MiDetermineUserGlobalPteMask(MappingPte);
NewPte->u.Long |= MmProtectToPteMask[ProtectionMask];
@@ -830,7 +845,10 @@ MI_MAKE_HARDWARE_PTE_USER(IN PMMPTE NewPte,
/* Start fresh */
NewPte->u.Long = 0;
- /* Set the protection and page */
+ /* Check that we are not setting valid a page that should not be */
+ ASSERT(ProtectionMask & MM_PROTECT_ACCESS);
+ ASSERT((ProtectionMask & MM_GUARDPAGE) == 0);
+
NewPte->u.Hard.Valid = TRUE;
NewPte->u.Hard.Owner = TRUE;
NewPte->u.Hard.PageFrameNumber = PageFrameNumber;
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d30a1673d48602fceadf9…
commit d30a1673d48602fceadf9e40dcd27603033c56a5
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Sun Jun 6 16:40:28 2021 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Sun Jun 6 16:40:28 2021 +0200
[SHELL32_APITEST] ShellHook testcase Fix compiler error (addendum to #3289)
addendum to 0.4.15-dev-1123-g 0089291751837d977431c85b6d8d6b1232fbb67b
Fix a compiler error on RosBE2.1.6 GCC4.7.2
that I got when I merged this test back to 0.4.14RC:
C:/0414rls/reactos/modules/rostests/apitests/shell32/ShellHook.cpp: In function
'LRESULT WindowProc(HWND, UINT, WPARAM, LPARAM)':
C:/0414rls/reactos/modules/rostests/apitests/shell32/ShellHook.cpp:339:26: error
: comparison between signed and unsigned integer expressions [-Werror=sign-compa
re]
cc1plus.exe: all warnings being treated as errors
ninja: build stopped: subcommand failed.
---
modules/rostests/apitests/shell32/ShellHook.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/rostests/apitests/shell32/ShellHook.cpp b/modules/rostests/apitests/shell32/ShellHook.cpp
index c1ab2eaa5df..0efabef3018 100644
--- a/modules/rostests/apitests/shell32/ShellHook.cpp
+++ b/modules/rostests/apitests/shell32/ShellHook.cpp
@@ -336,7 +336,7 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT i = (INT)wParam - ID_BURNING;
DoTestEntryPart2(&s_entries[i]);
++i;
- if (i == s_num_entries)
+ if (i == (INT)s_num_entries)
{
PostQuitMessage(0);
break;