changeset 406240a8e7ef in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=406240a8e7ef
description:
dev: Fix segfault in flash device
Fix a bug in which the flash device would write out of bounds and
could either trigger a segfault and corrupt the memory of other
objects. This was caused by using pageSize in the place of
pagesPerBlock when running the garbage collector.
Also, added an assert to flag this condition in the future.
diffstat:
src/dev/arm/flash_device.cc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (13 lines):
diff -r 8e240cd8132a -r 406240a8e7ef src/dev/arm/flash_device.cc
--- a/src/dev/arm/flash_device.cc Thu Oct 29 08:48:24 2015 -0400
+++ b/src/dev/arm/flash_device.cc Thu Oct 29 08:48:25 2015 -0400
@@ -379,7 +379,8 @@
block = locationTable[logic_page_addr].block * pagesPerBlock;
//assumption: clean will improve locality
- for (uint32_t count = 0; count < pageSize; count++) {
+ for (uint32_t count = 0; count < pagesPerBlock; count++) {
+ assert(block + count < pagesPerDisk);
locationTable[block + count].page = (block + count) %
pagesPerBlock;
++count;
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev