]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 8 Jan 2019 18:49:00 +0000 (18:49 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 28 Mar 2019 01:05:38 +0000 (20:05 -0500)
commit8ec7368c8fc1abad6dce931bd2d8fa8c79b0bbab
tree8151fef04bf8df635a6fd4c2eaac86130f16d3f0
parent85bfce130adcf26e2606c5e3b016d309fa1d3e1b
linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0

Linux returns success if pwrite64() or pread64() are called with a
zero length NULL buffer, but QEMU was returning -TARGET_EFAULT.

This is the same bug that we fixed in commit 58cfa6c2e6eb51b23cc9
for the write syscall, and long before that in 38d840e6790c29f59
for the read syscall.

Fixes: https://bugs.launchpad.net/qemu/+bug/1810433
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190108184900.9654-1-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
(cherry picked from commit 2bd3f8998e1e7dcd9afc29fab252fb9936f9e956)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
linux-user/syscall.c