qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] block: enforce constraints on block size properties
@ 2012-03-14 15:57 Stefan Hajnoczi
  2012-03-14 15:57 ` [Qemu-devel] [PATCH v2 1/3] qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2012-03-14 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Paolo Bonzini, Stefan Hajnoczi

This series ensures we only accept valid block sizes.  Although in theory block
sizes can vary a lot, the storage protocols (ATA, SCSI) as well as the QEMU
block layer implementation impose constraints.  Valid QEMU block sizes today
must meet:

 * Power of 2
 * Multiple of 512 bytes
 * Fits into uint16_t

Nicolae Mogoreanu <mogo@google.com> found that QEMU allows invalid block sizes
to be specified and this can cause it to crash when I/O is performed.

Stefan Hajnoczi (3):
  qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description
  qdev: add blocksize property type
  block: enforce constraints on block size properties

 block.h              |    8 ++++----
 hw/qdev-properties.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/qdev.h            |    3 +++
 qerror.c             |    7 ++++++-
 qerror.h             |    4 ++++
 5 files changed, 63 insertions(+), 5 deletions(-)

-- 
1.7.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-03-14 17:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-14 15:57 [Qemu-devel] [PATCH v2 0/3] block: enforce constraints on block size properties Stefan Hajnoczi
2012-03-14 15:57 ` [Qemu-devel] [PATCH v2 1/3] qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description Stefan Hajnoczi
2012-03-14 16:03   ` Paolo Bonzini
2012-03-14 15:57 ` [Qemu-devel] [PATCH v2 2/3] qdev: add blocksize property type Stefan Hajnoczi
2012-03-14 16:04   ` Paolo Bonzini
2012-03-14 15:57 ` [Qemu-devel] [PATCH v2 3/3] block: enforce constraints on block size properties Stefan Hajnoczi
2012-03-14 16:04   ` Paolo Bonzini
2012-03-14 16:13     ` Kevin Wolf
2012-03-14 17:08 ` [Qemu-devel] [PATCH v2 0/3] " Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).