[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/15] linux-user: fix ssetmask() system call
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 09/15] linux-user: fix ssetmask() system call |
Date: |
Wed, 31 May 2017 16:08:21 +0300 |
From: Miloš Stojanović <address@hidden>
Fix the ssetmask() system call by removing the invocation of sigorset().
The ssetmask() system call should replace the old signal mask
with the new and return the old mask. It shouldn't combine
the old and the new mask with sigorset(). Fetching the old
mask for sigorset() is also no longer needed.
The problem was detected after running LTP test group syscalls
for the MIPS EL 32 R2 architecture where the test ssetmask01 failed
with exit code 1. The test passes now that the ssetmask() system call
is fixed.
Signed-off-by: Miloš Stojanović <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 909dde6de6..93bc6f679e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8621,17 +8621,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
#ifdef TARGET_NR_ssetmask /* not on alpha */
case TARGET_NR_ssetmask:
{
- sigset_t set, oset, cur_set;
+ sigset_t set, oset;
abi_ulong target_set = arg1;
- /* We only have one word of the new mask so we must read
- * the rest of it with do_sigprocmask() and OR in this word.
- * We are guaranteed that a do_sigprocmask() that only queries
- * the signal mask will not fail.
- */
- ret = do_sigprocmask(0, NULL, &cur_set);
- assert(!ret);
target_to_host_old_sigset(&set, &target_set);
- sigorset(&set, &set, &cur_set);
ret = do_sigprocmask(SIG_SETMASK, &set, &oset);
if (!ret) {
host_to_target_old_sigset(&target_set, &oset);
--
2.11.0
- [Qemu-devel] [PULL 00/15] Misc linux-user updates, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 02/15] linux-user: fix eventfd, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 01/15] linux-user: call fd_trans_target_to_host_data() for write(), riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 03/15] linux-user: fix fadvise64_64() on ppc, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 04/15] linux-user: fix inotify, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 05/15] linux-user: allocate heap memory for execve arguments, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 08/15] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 09/15] linux-user: fix ssetmask() system call,
riku . voipio <=
- [Qemu-devel] [PULL 06/15] linux-user: remove all traces of qemu from /proc/self/cmdline, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 07/15] linux-user: add strace for getuid(), gettid(), getppid(), geteuid(), riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 10/15] linux-user: fix mismatch of lock/unlock_user() invocations in rt_sigqueinfo() syscall, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 12/15] linux-user: add support for rt_tgsigqueueinfo() system call, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 13/15] linux-user: add rt_tgsigqueueinfo() strace, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 14/15] linux-user: fix inconsistent spaces in print_siginfo() output, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 11/15] linux-user: fix argument type declaration of rt_sigqueinfo() syscall, riku . voipio, 2017/05/31
- [Qemu-devel] [PULL 15/15] linux-user: add strace support for uinfo structure of rt_sigqueueinfo() and rt_tgsigqueueinfo(), riku . voipio, 2017/05/31