diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-03-28 19:49:57 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-03-28 19:49:57 +0100 |
commit | ec2e6e016d24bd429792d08cf607e4c5350dcdaa (patch) | |
tree | 746dba2ed0886ca01744f775ad04e9b7ecdecdcd | |
parent | 7b9a3c9f94bcac23c534bc9f42a9e914b433b299 (diff) | |
parent | 4a1e6bce2308b720d79d5ea0a3d24501c89bd80c (diff) | |
download | qemu-ec2e6e016d24bd429792d08cf607e4c5350dcdaa.zip qemu-ec2e6e016d24bd429792d08cf607e4c5350dcdaa.tar.gz qemu-ec2e6e016d24bd429792d08cf607e4c5350dcdaa.tar.bz2 |
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging
linux-user pull request 20210328
- Fix recvfrom with NULL msg
- Fix sigreturn address on s390x
# gpg: Signature made Sun 28 Mar 2021 17:05:45 BST
# gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg: issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* remotes/vivier2/tags/linux-user-for-6.0-pull-request:
linux-user: allow NULL msg in recvfrom
linux-user/s390x: Use the guest pointer for the sigreturn stub
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | linux-user/s390x/signal.c | 5 | ||||
-rw-r--r-- | linux-user/syscall.c | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index ecfa2a1..7107c5f 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -211,9 +211,10 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa_flags & TARGET_SA_RESTORER) { - env->regs[14] = (unsigned long) ka->sa_restorer | PSW_ADDR_AMODE; + env->regs[14] = ka->sa_restorer | PSW_ADDR_AMODE; } else { - env->regs[14] = (unsigned long) frame->retcode | PSW_ADDR_AMODE; + env->regs[14] = (frame_addr + offsetof(typeof(*frame), retcode)) + | PSW_ADDR_AMODE; __put_user(S390_SYSCALL_OPCODE | TARGET_NR_rt_sigreturn, (uint16_t *)(frame->retcode)); } diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1e50857..294779c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3679,9 +3679,14 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags, void *host_msg; abi_long ret; - host_msg = lock_user(VERIFY_WRITE, msg, len, 0); - if (!host_msg) - return -TARGET_EFAULT; + if (!msg) { + host_msg = NULL; + } else { + host_msg = lock_user(VERIFY_WRITE, msg, len, 0); + if (!host_msg) { + return -TARGET_EFAULT; + } + } if (target_addr) { if (get_user_u32(addrlen, target_addrlen)) { ret = -TARGET_EFAULT; |