ide: Ignore reads during PIO in and writes during PIO out
authorKevin Wolf <kwolf@redhat.com>
Mon, 4 Jul 2011 12:07:50 +0000 (14:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 5 Jul 2011 09:23:42 +0000 (11:23 +0200)
commit40c4ed3f95f0b2ffa0848df0fc311556bb7472a1
treed2f03e334df959dbcfa037867e38b2b1f2552cfb
parente7ff8f0e0c03853c5018d683b28b338b9738588a
ide: Ignore reads during PIO in and writes during PIO out

This fixes https://bugs.launchpad.net/qemu/+bug/786209:

    When the DRQ_STAT bit is set, the IDE core permits both data reads
    and data writes, regardless of whether the current transfer was
    initiated as a read or write.

    This potentially leaks uninitialized host memory into the guest,
    if, before doing anything else to an IDE device, the guest begins a
    write transaction (e.g. WIN_WRITE), but then *reads* from the IO
    port instead of writing to it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
hw/ide/core.c