diff mbox series

[PULL,4/7] linux-user: Zero out target_siginfo_t in force_sig()

Message ID 20210924135631.2067582-5-laurent@vivier.eu
State New
Headers show
Series [PULL,1/7] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals | expand

Commit Message

Laurent Vivier Sept. 24, 2021, 1:56 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>


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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.31.1
diff mbox series

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index f8346f5ec5fd..910b9dc6f7d1 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -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;