diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-05-20 19:00:56 +0100 |
|---|---|---|
| committer | Riku Voipio <riku.voipio@linaro.org> | 2016-05-27 14:50:39 +0300 |
| commit | 99874f65526ed7827202c6e17c62f30d47652bdd (patch) | |
| tree | 9b4c841ab6e659a298bdb051b8551f72d7b814bb /migration/qemu-file-unix.c | |
| parent | c7e35da348e2e4df072e6979c48fa5283e07d1db (diff) | |
| download | focaccia-qemu-99874f65526ed7827202c6e17c62f30d47652bdd.tar.gz focaccia-qemu-99874f65526ed7827202c6e17c62f30d47652bdd.zip | |
linux-user: Handle msgrcv error case correctly
The msgrcv ABI is a bit odd -- the msgsz argument is a size_t, which is unsigned, but it must fail EINVAL if the value is negative when cast to a long. We were incorrectly passing the value through an "unsigned int", which meant that if the guest was 32-bit longs and the host was 64-bit longs an input of 0xffffffff (which should trigger EINVAL) would simply be passed to the host msgrcv() as 0xffffffff, where it does not cause the host kernel to reject it. Follow the same approach as do_msgsnd() in using a ssize_t and doing the check for negative values by hand, so we correctly fail in this corner case. This fixes the msgrcv03 Linux Test Project test case, which otherwise hangs. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'migration/qemu-file-unix.c')
0 files changed, 0 insertions, 0 deletions