[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] ide: Initialise buffers with zeros
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 8/8] ide: Initialise buffers with zeros |
Date: |
Wed, 6 Jul 2011 16:21:29 +0200 |
Just in case there's still a way how a guest can read out buffers when it's not
supposed to, let's zero the buffers during initialisation so that we don't leak
information to the guest.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
hw/ide/core.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index a29ae9f..d145b19 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1789,9 +1789,13 @@ static void ide_init1(IDEBus *bus, int unit)
s->unit = unit;
s->drive_serial = drive_serial++;
/* we need at least 2k alignment for accessing CDROMs using O_DIRECT */
- s->io_buffer = qemu_memalign(2048, IDE_DMA_BUF_SECTORS*512 + 4);
s->io_buffer_total_len = IDE_DMA_BUF_SECTORS*512 + 4;
+ s->io_buffer = qemu_memalign(2048, s->io_buffer_total_len);
+ memset(s->io_buffer, 0, s->io_buffer_total_len);
+
s->smart_selftest_data = qemu_blockalign(s->bs, 512);
+ memset(s->smart_selftest_data, 0, 512);
+
s->sector_write_timer = qemu_new_timer_ns(vm_clock,
ide_sector_write_timer_cb, s);
}
--
1.7.6
- [Qemu-devel] [PULL 0/8] Block patches, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 1/8] Documentation: Remove outdated host_device note, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 2/8] qemu-img: Add cache command line option, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 3/8] block/raw-posix: Linux compat-ioctl warning workaround, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 4/8] virtio-blk: Turn drive serial into a qdev property, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 5/8] block: drive_init(): Simplify interface type setting, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 6/8] block: drive_init(): Improve CHS setting error message, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 7/8] ide: Ignore reads during PIO in and writes during PIO out, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 8/8] ide: Initialise buffers with zeros,
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 0/8] Block patches, Kevin Wolf, 2011/07/12
- Re: [Qemu-devel] [PULL 0/8] Block patches, Anthony Liguori, 2011/07/12