]> git.ipfire.org Git - thirdparty/qemu.git/commit
ivshmem: Check ivshmem_read() size argument
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 Sep 2014 16:40:05 +0000 (18:40 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 6 Jan 2015 21:43:03 +0000 (15:43 -0600)
commitf1a842948a20ea25fef1d0f842b115805b269c02
treefb8bf160218cfcf72eab264e6920ead0ffe87c26
parent09d552b40f79c53a7faa8c85a4ffc2dd52d7b94c
ivshmem: Check ivshmem_read() size argument

The third argument to the fd_read() callback implemented by
ivshmem_read() is the number of bytes, not a flags field.  Fix this and
check we received enough bytes before accessing the buffer pointer.

Cc: Cam Macdonell <cam@cs.ualberta.ca>
Reported-by: Sebastian Krahmer <krahmer@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[AF: Handle partial reads via FIFO]
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit a2e9011b4164894594bf0b2a2a59e9c55c58c17b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/misc/ivshmem.c