[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt
Re: [Qemu-trivial] [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen
Sun, 12 Jan 2014 19:07:15 +0000
On 11 January 2014 09:34, <address@hidden> wrote:
> From: Pavel Zbitskiy <address@hidden>
> optlen parameter of getsockopt() of type socklen_t* was read into
> variable of type socklen_t, that caused zeroing out of upper 4 bytes
> when running s390x on top of x86_64. This patch changes optlen type
> to abi_ulong.
This patch and patch 3 are correct fixes, but shouldn't we be
more generally using abi_ulong for every argument we read from
the guest in do_socketcall() ?
It might be nicer to fix this by having a lookup table of SOCKOP_*
to number-of-arguments, and then hoist the get_user_ual() calls
outside the switch() statement to fill in an 'abi_ulong args' array.
Then the individual calls in the switch would just look like
do_socket(args, args, args);