[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 7/8] linux-user: correct errno returned from accept4() syscall
From: |
Laurent Vivier |
Subject: |
[PULL 7/8] linux-user: correct errno returned from accept4() syscall |
Date: |
Mon, 26 Oct 2020 23:03:38 +0100 |
From: Matus Kysel <mkysel@tachyum.com>
accept4() returned wrong errno, that did not match current linux
Signed-off-by: Matus Kysel <mkysel@tachyum.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200930151616.3588165-1-mkysel@tachyum.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f0df6aecef80..6fef8181e738 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3491,16 +3491,16 @@ static abi_long do_accept4(int fd, abi_ulong
target_addr,
return get_errno(safe_accept4(fd, NULL, NULL, host_flags));
}
- /* linux returns EINVAL if addrlen pointer is invalid */
+ /* linux returns EFAULT if addrlen pointer is invalid */
if (get_user_u32(addrlen, target_addrlen_addr))
- return -TARGET_EINVAL;
+ return -TARGET_EFAULT;
if ((int)addrlen < 0) {
return -TARGET_EINVAL;
}
if (!access_ok(VERIFY_WRITE, target_addr, addrlen))
- return -TARGET_EINVAL;
+ return -TARGET_EFAULT;
addr = alloca(addrlen);
--
2.26.2
- [PULL 0/8] Linux user for 5.2 patches, Laurent Vivier, 2020/10/26
- [PULL 2/8] linux-user: Support f_flags in statfs64 when available., Laurent Vivier, 2020/10/26
- [PULL 4/8] linux-user: update mips/syscall-args-o32.c.inc to Linux 5.9-rc7, Laurent Vivier, 2020/10/26
- [PULL 1/8] Fix stack smashing when handling PR_GET_PDEATHSIG, Laurent Vivier, 2020/10/26
- [PULL 8/8] target/xtensa: enable all coprocessors for linux-user, Laurent Vivier, 2020/10/26
- [PULL 5/8] linux-user: update syscall.tbl to Linux 5.9-rc7, Laurent Vivier, 2020/10/26
- [PULL 6/8] linux-user: remove _sysctl, Laurent Vivier, 2020/10/26
- [PULL 3/8] linux-user: update syscall_nr.h to Linux 5.9-rc7, Laurent Vivier, 2020/10/26
- [PULL 7/8] linux-user: correct errno returned from accept4() syscall,
Laurent Vivier <=
- Re: [PULL 0/8] Linux user for 5.2 patches, Peter Maydell, 2020/10/28