On 11 January 2014 09:34,  <pavel.zbits...@gmail.com> wrote:
> From: Pavel Zbitskiy <pavel.zbits...@gmail.com>
>
> 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[0], args[1], args[2]);

thanks
-- PMM

Reply via email to