This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
RedBoot - improve FLASH boundary check
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: 09 Oct 2003 15:34:57 -0600
- Subject: RedBoot - improve FLASH boundary check
- Organization: MLB Associates
Need to check the image length, not size, when validating addresses.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.148
diff -u -5 -p -r1.148 ChangeLog
--- redboot/current/ChangeLog 9 Oct 2003 20:23:36 -0000 1.148
+++ redboot/current/ChangeLog 9 Oct 2003 21:33:44 -0000
@@ -1,7 +1,10 @@
2003-10-09 Gary Thomas <gary@mlbassoc.com>
+ * src/flash.c (fis_create): Check whole length of image, not just
+ effective size, when validating addresses.
+
* src/net/net_io.c (net_init):
* include/net/net.h: Rework handling of multiple network devices. All
devices will now be initialized, with either the first or the default
device actually used for I/O.
Index: redboot/current/src/flash.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/flash.c,v
retrieving revision 1.54
diff -u -5 -p -r1.54 flash.c
--- redboot/current/src/flash.c 6 Oct 2003 15:42:05 -0000 1.54
+++ redboot/current/src/flash.c 9 Oct 2003 20:55:20 -0000
@@ -699,11 +699,11 @@ fis_create(int argc, char *argv[])
return;
}
#endif
if (flash_addr_set &&
((stat = flash_verify_addr((void *)flash_addr)) ||
- (stat = flash_verify_addr((void *)(flash_addr+img_size-1))))) {
+ (stat = flash_verify_addr((void *)(flash_addr+length-1))))) {
_show_invalid_flash_address(flash_addr, stat);
return;
}
if (flash_addr_set && flash_addr & (flash_block_size-1)) {
diag_printf("Invalid FLASH address: %p\n", (void *)flash_addr);