Re: [PATCH] linux-user: Drop unnecessary check in dup3 syscall

2020-04-25 Thread Peter Maydell
On Fri, 24 Apr 2020 at 22:33, Eric Blake wrote: > I don't think this is quite correct. target_to_host_bitmask() silently > ignores unknown bits, and a user that was relying on bit 0x4000 to > cause an EINVAL will not fail with this change (unless bit 0x4000 > happens to be one of the bits

Re: [PATCH] linux-user: Drop unnecessary check in dup3 syscall

2020-04-24 Thread Eric Blake
On 4/24/20 4:47 PM, Helge Deller wrote: -    host_flags = target_to_host_bitmask(arg3, fcntl_flags_tbl); +    int host_flags = target_to_host_bitmask(arg3, fcntl_flags_tbl); I don't think this is quite correct. target_to_host_bitmask() silently ignores unknown bits, and a user that wa

Re: [PATCH] linux-user: Drop unnecessary check in dup3 syscall

2020-04-24 Thread Helge Deller
On 24.04.20 23:32, Eric Blake wrote: > On 4/24/20 3:57 PM, Helge Deller wrote: >> Drop the extra check in dup3() if anything other than FD_CLOEXEC (aka >> O_CLOEXEC) was given. Instead simply rely on any error codes returned by >> the host dup3() syscall. >> >> Signed-off-by: Helge Deller >> >> di

Re: [PATCH] linux-user: Drop unnecessary check in dup3 syscall

2020-04-24 Thread Eric Blake
On 4/24/20 3:57 PM, Helge Deller wrote: Drop the extra check in dup3() if anything other than FD_CLOEXEC (aka O_CLOEXEC) was given. Instead simply rely on any error codes returned by the host dup3() syscall. Signed-off-by: Helge Deller diff --git a/linux-user/syscall.c b/linux-user/syscall.c i

[PATCH] linux-user: Drop unnecessary check in dup3 syscall

2020-04-24 Thread Helge Deller
Drop the extra check in dup3() if anything other than FD_CLOEXEC (aka O_CLOEXEC) was given. Instead simply rely on any error codes returned by the host dup3() syscall. Signed-off-by: Helge Deller diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 05f03919ff..ebf0d38321 100644 --- a/l