linux-user: use __get_user and __put_user in cmsg conversions
commit876e23cb2e545148a0ee4effda5c63c861855941
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 26 May 2015 18:46:32 +0000 (26 19:46 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 16 Jun 2015 05:21:01 +0000 (16 08:21 +0300)
tree75a5046e01f5b4b92e6638c41e336dfd1495c4de
parentc2aeb2586bd258ad76fcfe308f883075e73ff1d2
linux-user: use __get_user and __put_user in cmsg conversions

The target payloads in cmsg conversions may not have the alignment
required by the host. Using the get_user and put_user functions is
the easiest way to handle this and also do the byte-swapping we
require.

(Note that prior to this commit target_to_host_cmsg was incorrectly
using __put_user() rather than __get_user() for the SCM_CREDENTIALS
conversion, which meant it wasn't getting the benefit of the
misalignment handling.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c