[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/30] linux-user: Zero out target_siginfo_t in force_sig()
From: |
Richard Henderson |
Subject: |
[PATCH v2 04/30] linux-user: Zero out target_siginfo_t in force_sig() |
Date: |
Sat, 21 Aug 2021 20:55:11 -0700 |
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>
Message-Id: <20210813131809.28655-5-peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index a8faea6f09..fd3c6a3e60 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -636,7 +636,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;
--
2.25.1
- [PATCH v2 00/30] linux-user: Clean up siginfo_t handling, Richard Henderson, 2021/08/21
- [PATCH v2 01/30] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals, Richard Henderson, 2021/08/21
- [PATCH v2 04/30] linux-user: Zero out target_siginfo_t in force_sig(),
Richard Henderson <=
- [PATCH v2 02/30] linux-user/arm: Set siginfo_t addr field for SIGTRAP signals, Richard Henderson, 2021/08/21
- [PATCH v2 05/30] linux-user: Provide new force_sig_fault() function, Richard Henderson, 2021/08/21
- [PATCH v2 06/30] linux-user: Provide new force_sigsegv_for_addr() function, Richard Henderson, 2021/08/21
- [PATCH v2 03/30] linux-user/arm: Use force_sig() to deliver fpa11 emulation SIGFPE, Richard Henderson, 2021/08/21
- [PATCH v2 07/30] linux-user/arm: Use force_sig_fault(), Richard Henderson, 2021/08/21
- [PATCH v2 14/30] linux-user/hppa: Use force_sig_fault, force_sigsegv_for_addr, Richard Henderson, 2021/08/21