qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-3.1 0/2] hw/block/onenand: fix out-of-bounds read
@ 2018-11-15 14:35 Peter Maydell
  2018-11-15 14:35 ` [Qemu-devel] [PATCH for-3.1 1/2] hw/block/onenand: Fix off-by-one error allowing " Peter Maydell
  2018-11-15 14:35 ` [Qemu-devel] [PATCH for-3.1 2/2] hw/block/onenand: use qemu_log_mask() for reporting Peter Maydell
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Maydell @ 2018-11-15 14:35 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: patches, Thomas Huth, Richard Henderson

An off-by-one error in a switch case in onenand_read() allowed
a misbehaving guest to read off the end of a block of memory.
This bug was revealed now that QEMU supports execution from
device memory: if started with no guest image loaded,
"qemu-system-arm -M n800" will now try to execute by reading
from this device's registers until it gets to the offset
triggering the segfault. Previously it would have run into
the "can't execute from device memory" assert first.

As a followup, patch 2 fixes some reporting so that we don't
trigger a hw_error() for reads of unimplemented registers.
With the two patches, execution now successfully results in
QEMU emulating the guest being off in the weeds...
    
NB: the onenand device is used only by the "n800" and "n810"
machines, which are usable only with TCG, not KVM, so the
segfault is not a security issue.

thanks
-- PMM

Peter Maydell (2):
  hw/block/onenand: Fix off-by-one error allowing out-of-bounds read
  hw/block/onenand: use qemu_log_mask() for reporting

 hw/block/onenand.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

-- 
2.19.1

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

end of thread, other threads:[~2018-11-16  6:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-15 14:35 [Qemu-devel] [PATCH for-3.1 0/2] hw/block/onenand: fix out-of-bounds read Peter Maydell
2018-11-15 14:35 ` [Qemu-devel] [PATCH for-3.1 1/2] hw/block/onenand: Fix off-by-one error allowing " Peter Maydell
2018-11-15 14:49   ` Philippe Mathieu-Daudé
2018-11-15 16:27   ` Richard Henderson
2018-11-15 14:35 ` [Qemu-devel] [PATCH for-3.1 2/2] hw/block/onenand: use qemu_log_mask() for reporting Peter Maydell
2018-11-15 14:48   ` Philippe Mathieu-Daudé
2018-11-15 16:28   ` Richard Henderson
2018-11-16  6:19   ` Thomas Huth

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).