aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-28 19:49:57 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-03-28 19:49:57 +0100
commitec2e6e016d24bd429792d08cf607e4c5350dcdaa (patch)
tree746dba2ed0886ca01744f775ad04e9b7ecdecdcd /linux-user/syscall.c
parent7b9a3c9f94bcac23c534bc9f42a9e914b433b299 (diff)
parent4a1e6bce2308b720d79d5ea0a3d24501c89bd80c (diff)
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>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1e508576c7..294779c86f 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;