[PATCH] ntdll: Initialize USR1 handler XSTATE buffer (valgrind).

Rémi Bernon rbernon at codeweavers.com
Mon Mar 8 02:14:21 CST 2021


  Conditional jump or move depends on uninitialised value(s)
     at 0x46AC989: NtGetContextThread (signal_x86_64.c:2002)

  Conditional jump or move depends on uninitialised value(s)
     at 0x46ABA1E: xstate_to_server (unix_private.h:342)
     by 0x46ABA1E: context_to_server (signal_x86_64.c:1698)

  Conditional jump or move depends on uninitialised value(s)
     at 0x46AC18F: NtSetContextThread (signal_x86_64.c:1859)

There's still some uninitialized bytes being passed to writev, but that
seems to come from the pushfd instruction, and could probably be flagged
as false positive.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/ntdll/unix/signal_x86_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 2a030372fb7..d0f3ece266c 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2642,6 +2642,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *ucontext )
         DECLSPEC_ALIGN(64) XSTATE xs;
         context.c.ContextFlags = CONTEXT_FULL;
         context_init_xstate( &context.c, &xs );
+        memset( &xs, 0, offsetof(XSTATE, YmmContext) );
 
         NtGetContextThread( GetCurrentThread(), &context.c );
         wait_suspend( &context.c );
-- 
2.30.0




More information about the wine-devel mailing list