* [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags
@ 2014-04-03 12:51 riku.voipio
2014-04-03 12:51 ` [Qemu-devel] [PULL for-2.0] linux-user: pass correct host flags to accept4() riku.voipio
2014-04-03 14:42 ` [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: riku.voipio @ 2014-04-03 12:51 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Riku Voipio
From: Riku Voipio <riku.voipio@linaro.org>
The following changes since commit 63678e17cf399ff81b93417fe7bee8d6ef6b6b1b:
configure: add option to disable -fstack-protector flags (2014-03-31 20:16:02 +0100)
are available in the git repository at:
git://git.linaro.org/people/riku.voipio/qemu.git for-2.0
for you to fetch changes up to d25295d4efc53bf8521adf967445b8d087fe8d39:
linux-user: pass correct host flags to accept4() (2014-04-01 09:17:19 +0300)
Petar Jovanovic (1):
linux-user: pass correct host flags to accept4()
linux-user/syscall.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--
1.8.5.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL for-2.0] linux-user: pass correct host flags to accept4()
2014-04-03 12:51 [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags riku.voipio
@ 2014-04-03 12:51 ` riku.voipio
2014-04-03 14:42 ` [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: riku.voipio @ 2014-04-03 12:51 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Petar Jovanovic
From: Petar Jovanovic <petar.jovanovic@imgtec.com>
Flags NONBLOCK and CLOEXEC can have different values on the host and the
guest, so set correct host values before calling accept4().
This fixes several issues with accept4 system call and user-mode of QEMU.
Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
linux-user/syscall.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2eac6d5..9864813 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2062,9 +2062,12 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
socklen_t addrlen;
void *addr;
abi_long ret;
+ int host_flags;
+
+ host_flags = target_to_host_bitmask(flags, fcntl_flags_tbl);
if (target_addr == 0) {
- return get_errno(accept4(fd, NULL, NULL, flags));
+ return get_errno(accept4(fd, NULL, NULL, host_flags));
}
/* linux returns EINVAL if addrlen pointer is invalid */
@@ -2080,7 +2083,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
addr = alloca(addrlen);
- ret = get_errno(accept4(fd, addr, &addrlen, flags));
+ ret = get_errno(accept4(fd, addr, &addrlen, host_flags));
if (!is_error(ret)) {
host_to_target_sockaddr(target_addr, addr, addrlen);
if (put_user_u32(addrlen, target_addrlen_addr))
--
1.8.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags
2014-04-03 12:51 [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags riku.voipio
2014-04-03 12:51 ` [Qemu-devel] [PULL for-2.0] linux-user: pass correct host flags to accept4() riku.voipio
@ 2014-04-03 14:42 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-04-03 14:42 UTC (permalink / raw)
To: Riku Voipio; +Cc: QEMU Developers
On 3 April 2014 13:51, <riku.voipio@linaro.org> wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
>
> The following changes since commit 63678e17cf399ff81b93417fe7bee8d6ef6b6b1b:
>
> configure: add option to disable -fstack-protector flags (2014-03-31 20:16:02 +0100)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/riku.voipio/qemu.git for-2.0
>
> for you to fetch changes up to d25295d4efc53bf8521adf967445b8d087fe8d39:
>
> linux-user: pass correct host flags to accept4() (2014-04-01 09:17:19 +0300)
>
> Petar Jovanovic (1):
> linux-user: pass correct host flags to accept4()
>
> linux-user/syscall.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-03 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 12:51 [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags riku.voipio
2014-04-03 12:51 ` [Qemu-devel] [PULL for-2.0] linux-user: pass correct host flags to accept4() riku.voipio
2014-04-03 14:42 ` [Qemu-devel] [PULL for-2.0] linux-user: fix accept4 flags Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).