[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/10] linux-user: Properly handle sigset arg to epoll_pwait
From: |
Laurent Vivier |
Subject: |
[PULL 05/10] linux-user: Properly handle sigset arg to epoll_pwait |
Date: |
Thu, 24 Mar 2022 09:20:11 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Unblocked signals are never delivered, because we
didn't record the new mask for process_pending_signals.
Handle this with the same mechanism as sigsuspend.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220315084308.433109-5-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ffd4cefc8b7a..67af40deac07 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -12694,29 +12694,21 @@ static abi_long do_syscall1(void *cpu_env, int num,
abi_long arg1,
#if defined(TARGET_NR_epoll_pwait)
case TARGET_NR_epoll_pwait:
{
- target_sigset_t *target_set;
- sigset_t _set, *set = &_set;
+ sigset_t *set = NULL;
if (arg5) {
- if (arg6 != sizeof(target_sigset_t)) {
- ret = -TARGET_EINVAL;
- break;
- }
-
- target_set = lock_user(VERIFY_READ, arg5,
- sizeof(target_sigset_t), 1);
- if (!target_set) {
- ret = -TARGET_EFAULT;
+ ret = process_sigsuspend_mask(&set, arg5, arg6);
+ if (ret != 0) {
break;
}
- target_to_host_sigset(set, target_set);
- unlock_user(target_set, arg5, 0);
- } else {
- set = NULL;
}
ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents, timeout,
set, SIGSET_T_SIZE));
+
+ if (set) {
+ finish_sigsuspend_mask(ret);
+ }
break;
}
#endif
--
2.35.1
- [PULL 00/10] Linux user for 7.0 patches, Laurent Vivier, 2022/03/24
- [PULL 02/10] linux-user/alpha: Fix sigsuspend for big-endian hosts, Laurent Vivier, 2022/03/24
- [PULL 03/10] linux-user: Split out helpers for sigsuspend, Laurent Vivier, 2022/03/24
- [PULL 06/10] linux-user: Properly handle sigset arg to ppoll, Laurent Vivier, 2022/03/24
- [PULL 08/10] linux-user/arm: Implement __kernel_memory_barrier, Laurent Vivier, 2022/03/24
- [PULL 10/10] linux-user/arm: Implement __kernel_cmpxchg64 with host atomics, Laurent Vivier, 2022/03/24
- [PULL 07/10] linux-user: Fix missing space in error message, Laurent Vivier, 2022/03/24
- [PULL 04/10] linux-user: Properly handle sigset arg to pselect, Laurent Vivier, 2022/03/24
- [PULL 05/10] linux-user: Properly handle sigset arg to epoll_pwait,
Laurent Vivier <=
- [PULL 09/10] linux-user/arm: Implement __kernel_cmpxchg with host atomics, Laurent Vivier, 2022/03/24
- [PULL 01/10] linux-user: Fix syscall parameter handling for MIPS n32, Laurent Vivier, 2022/03/24
- Re: [PULL 00/10] Linux user for 7.0 patches, Peter Maydell, 2022/03/24