]> Git Repo - qemu.git/commitdiff
hw/block/onenand: Fix off-by-one error allowing out-of-bounds read
authorPeter Maydell <[email protected]>
Mon, 19 Nov 2018 15:29:08 +0000 (15:29 +0000)
committerPeter Maydell <[email protected]>
Mon, 19 Nov 2018 15:55:11 +0000 (15:55 +0000)
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.

NB: the onenand device is used only by the "n800" and "n810"
machines, which are usable only with TCG, not KVM, so this is
not a security issue.

Reported-by: Thomas Huth <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
Message-id: 20181115143535[email protected]
Suggested-by: Richard Henderson <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/block/onenand.c

index 0cb8d7fa135fe9a6e53cc6b83737e4daaabf5aea..49ef68c9b1484293c91a425625cbba216057b9be 100644 (file)
@@ -608,7 +608,7 @@ static uint64_t onenand_read(void *opaque, hwaddr addr,
     int offset = addr >> s->shift;
 
     switch (offset) {
-    case 0x0000 ... 0xc000:
+    case 0x0000 ... 0xbffe:
         return lduw_le_p(s->boot[0] + addr);
 
     case 0xf000:       /* Manufacturer ID */
This page took 0.023353 seconds and 4 git commands to generate.