qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 18/19] linux-user: Avoid possible misalignmen


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v2 18/19] linux-user: Avoid possible misalignment in host_to_target_siginfo()
Date: Wed, 8 Jun 2016 11:29:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0


Le 07/06/2016 à 23:08, Peter Maydell a écrit :
> On 7 June 2016 at 20:36, Laurent Vivier <address@hidden> wrote:
>>
>>
>> Le 27/05/2016 à 16:52, Peter Maydell a écrit :
>>> host_to_target_siginfo() is implemented by a combination of
>>> host_to_target_siginfo_noswap() followed by tswap_siginfo().
>>> The first of these two functions assumes that the target_siginfo_t
>>> it is writing to is correctly aligned, but the pointer passed
>>> into host_to_target_siginfo() is directly from the guest and
>>> might be misaligned. Use a local variable to avoid this problem.
>>> (tswap_siginfo() does now correctly handle a misaligned destination.)
>>
>> You mean the pointer from the guest can not be correctly aligned for the
>> guest?
> 
> Might not be correctly aligned for the host (for that matter
> it might not be correctly aligned for the guest,
> if the guest is being malicious or buggy, but it's the
> host alignment we care about.)

Because of the "abi_ulong _addr", I think this structure is always
aligned for the guest.

Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]