diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-05-15 14:40:23 +0100 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2014-06-17 09:21:41 +0300 |
commit | be3bd286bc06bb68cdc71748d9dd4edcd57b2b24 (patch) | |
tree | 8003dc4f8cdfed7de229c5d2e2843d72698c3027 /.gitmodules | |
parent | 4d13be8b8b817cbca7db2f880628d7ae5b74799f (diff) | |
download | qemu-be3bd286bc06bb68cdc71748d9dd4edcd57b2b24.zip qemu-be3bd286bc06bb68cdc71748d9dd4edcd57b2b24.tar.gz qemu-be3bd286bc06bb68cdc71748d9dd4edcd57b2b24.tar.bz2 |
linux-user: Don't overrun guest buffer in sched_getaffinity
If the guest's "long" type is smaller than the host's, then
our sched_getaffinity wrapper needs to round the buffer size
up to a multiple of the host sizeof(long). This means that when
we copy the data back from the host buffer to the guest's
buffer there might be more than we can fit. Rather than
overflowing the guest's buffer, handle this case by returning
EINVAL or ignoring the unused extra space, as appropriate.
Note that only guests using the syscall interface directly might
run into this bug -- the glibc wrappers around it will always
use a buffer whose size is a multiple of 8 regardless of guest
architecture.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to '.gitmodules')
0 files changed, 0 insertions, 0 deletions