[PATCH 1/1] rtas_flash_4gig

moilanen at austin.ibm.com moilanen at austin.ibm.com
Tue Oct 5 05:43:05 EST 2004


We should probably check to make sure that all of the flash
list headers are above 4gig.  Not just the first one.

We could see this situation happen if we are low on memory 
and get a paged alloc'd that's over the 4 gig boundary.

Jake

Signed-off-by: Jake Moilanen <moilanen at austin.ibm.com>


---


diff -puN arch/ppc64/kernel/rtas.c~rtas_flash_4gig arch/ppc64/kernel/rtas.c
--- linux-2.6-bk/arch/ppc64/kernel/rtas.c~rtas_flash_4gig	Mon Oct  4 10:46:46 2004
+++ linux-2.6-bk-moilanen/arch/ppc64/kernel/rtas.c	Mon Oct  4 14:22:31 2004
@@ -338,6 +338,12 @@ rtas_flash_firmware(void)
 			f->next = (struct flash_block_list *)virt_to_abs(f->next);
 		else
 			f->next = NULL;
+
+		if (f->next >= 4UL*1024*1024*1024) {
+			printk(KERN_ALERT "FLASH: aborted...flash list header addr above 4GB\n");
+			return;
+		}
+
 		/* make num_blocks into the version/length field */
 		f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
 	}

_



More information about the Linuxppc64-dev mailing list