From bc584bdf9994b8e17034e94a02788a8996aec9e9 Mon Sep 17 00:00:00 2001 From: Nguyen Trung Khanh Date: Sat, 15 Aug 2020 17:18:35 +0700 Subject: [PATCH] [NTOS:PS] Fix stack memory disclosure in PsGetContextThread #3024 Fix stack memory disclosure in PsGetContextThread. --- ntoskrnl/ps/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/ps/debug.c b/ntoskrnl/ps/debug.c index d87595a8d54..b7ea2db32eb 100644 --- a/ntoskrnl/ps/debug.c +++ b/ntoskrnl/ps/debug.c @@ -112,7 +112,7 @@ PsGetContextThread(IN PETHREAD Thread, /* Enter SEH */ _SEH2_TRY { - /* Set default ength */ + /* Set default length */ Size = sizeof(CONTEXT); /* Read the flags */ @@ -146,6 +146,7 @@ PsGetContextThread(IN PETHREAD Thread, KeInitializeEvent(&GetSetContext.Event, NotificationEvent, FALSE); /* Set the flags and previous mode */ + RtlZeroMemory(&GetSetContext.Context, Size); GetSetContext.Context.ContextFlags = Flags; GetSetContext.Mode = PreviousMode;