]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: Zero out target_siginfo_t in force_sig()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 13 Aug 2021 13:18:06 +0000 (14:18 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 23 Sep 2021 12:42:55 +0000 (14:42 +0200)
The target_siginfo_t we populate in force_sig() will eventually
get copied onto the target's stack. Zero it out so that any extra
padding in the sifields union is consistently zero when the guest
sees it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210813131809.28655-5-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/signal.c

index f8346f5ec5fd6b8cd48d785ac9bc8576e93ea577..910b9dc6f7d18d5a0573c76ba0900aa44fbb23f6 100644 (file)
@@ -641,7 +641,7 @@ void force_sig(int sig)
 {
     CPUState *cpu = thread_cpu;
     CPUArchState *env = cpu->env_ptr;
-    target_siginfo_t info;
+    target_siginfo_t info = {};
 
     info.si_signo = sig;
     info.si_errno = 0;