diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-06-13 11:22:05 +0100 |
|---|---|---|
| committer | Riku Voipio <riku.voipio@linaro.org> | 2016-06-24 11:55:44 +0300 |
| commit | 55d72a7eb32858d50ba0777cfde2027d007010b2 (patch) | |
| tree | aee8282bced8d478e2315c800e1bff4c5e215bf9 /linux-user/qemu.h | |
| parent | c7288767523f6510cf557707d3eb5e78e519b90d (diff) | |
| download | focaccia-qemu-55d72a7eb32858d50ba0777cfde2027d007010b2.tar.gz focaccia-qemu-55d72a7eb32858d50ba0777cfde2027d007010b2.zip | |
linux-user: Avoid possible misalignment in host_to_target_siginfo()
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.) We have to add a memset() to host_to_target_siginfo_noswap() to avoid some false positive "may be used uninitialized" warnings from gcc about subfields of the _sifields union if it chooses to inline both tswap_siginfo() and host_to_target_siginfo_noswap() into host_to_target_siginfo(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Peter Maydell <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/qemu.h')
0 files changed, 0 insertions, 0 deletions