]> xenbits.xensource.com Git - qemu-xen-4.6-testing.git/commit
ide: Check array bounds before writing to io_buffer (CVE-2015-5154)
authorKevin Wolf <kwolf@redhat.com>
Wed, 3 Jun 2015 12:13:31 +0000 (14:13 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 29 Jul 2015 15:32:01 +0000 (16:32 +0100)
commitd18ac5938d38ed9a9d51e380a2baf8343468f65d
tree03c72f65f18ab2f7a3aee94281af4b787cd3e6a5
parent3e2e51ecc1120bd59537ed19b6bc7066511c7e2e
ide: Check array bounds before writing to io_buffer (CVE-2015-5154)

If the end_transfer_func of a command is called because enough data has
been read or written for the current PIO transfer, and it fails to
correctly call the command completion functions, the DRQ bit in the
status register and s->end_transfer_func may remain set. This allows the
guest to access further bytes in s->io_buffer beyond s->data_end, and
eventually overflowing the io_buffer.

One case where this currently happens is emulation of the ATAPI command
START STOP UNIT.

This patch fixes the problem by adding explicit array bounds checks
before accessing the buffer instead of relying on end_transfer_func to
function correctly.

[ This is XSA-138 / CVE-2015-5154. ]

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide.c