https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81be201d982969c728ac1…
commit 81be201d982969c728ac14df6a4f48a4fc6cf26b
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sat Oct 31 15:18:02 2020 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Oct 31 15:18:02 2020 +0100
[NTOS:CC] CcMdl*Complete(): Return if FastIO succeeded (#3303)
CORE-17342
---
ntoskrnl/cc/mdl.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/ntoskrnl/cc/mdl.c b/ntoskrnl/cc/mdl.c
index 12d63c1a39e..a1b726c35c2 100644
--- a/ntoskrnl/cc/mdl.c
+++ b/ntoskrnl/cc/mdl.c
@@ -101,10 +101,14 @@ CcMdlReadComplete (
/* Check if we support Fast Calls, and check this one */
if (FastDispatch && FastDispatch->MdlReadComplete)
{
- /* Use the fast path */
- FastDispatch->MdlReadComplete(FileObject,
- MdlChain,
- DeviceObject);
+ /* Use the fast path */
+ if (FastDispatch->MdlReadComplete(FileObject,
+ MdlChain,
+ DeviceObject))
+ {
+ /* Request was handled */
+ return;
+ }
}
/* Use slow path */
@@ -131,11 +135,15 @@ CcMdlWriteComplete (
/* Check if we support Fast Calls, and check this one */
if (FastDispatch && FastDispatch->MdlWriteComplete)
{
- /* Use the fast path */
- FastDispatch->MdlWriteComplete(FileObject,
- FileOffset,
- MdlChain,
- DeviceObject);
+ /* Use the fast path */
+ if (FastDispatch->MdlWriteComplete(FileObject,
+ FileOffset,
+ MdlChain,
+ DeviceObject))
+ {
+ /* Request was handled */
+ return;
+ }
}
/* Use slow path */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f66a7e2e482f6dbcf1710…
commit f66a7e2e482f6dbcf171018a60e6807d5a66a6ba
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Jan 6 00:51:43 2020 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Oct 31 14:23:16 2020 +0100
[NTOS:KE:X64] Zero out the context in KiDispatchException
---
ntoskrnl/ke/amd64/except.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/ke/amd64/except.c b/ntoskrnl/ke/amd64/except.c
index 23ff7e016a9..40b01064d84 100644
--- a/ntoskrnl/ke/amd64/except.c
+++ b/ntoskrnl/ke/amd64/except.c
@@ -245,10 +245,13 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
/* Increase number of Exception Dispatches */
KeGetCurrentPrcb()->KeExceptionDispatchCount++;
+ /* Zero out the context to avoid leaking kernel stack memor to user mode */
+ RtlZeroMemory(&Context, sizeof(Context));
+
/* Set the context flags */
Context.ContextFlags = CONTEXT_ALL;
- /* Get a Context */
+ /* Get the Context from the trap and exception frame */
KeTrapFrameToContext(TrapFrame, ExceptionFrame, &Context);
/* Look at our exception code */