Date: Fri, 30 Sep 2005 18:40:08 +0100 (BST) From: Jim Hawkins To: linux-arm-kernel@lists.arm.linux.org.uk Subject: [PATCH] Risc PC + zImage + tagged list Hi, Booting a Risc PC with a compressed kernel image using a kernel tagged list can result in memory corruption. The implementation of putstr in include/asm-arm/arch-rpc/uncompress.h assumes the boot loader passed in a struct param_struct and then tries to print the string to the display using the video params in the struct. The attached patch against 2.6.13.1 checks for a kernel tagged list and disables video output in this case. Cheers, Jim diff -urN linux-2.6.13.1.orig/include/asm-arm/arch-rpc/uncompress.h linux-2.6.13.1/include/asm-arm/arch-rpc/uncompress.h --- linux-2.6.13.1.orig/include/asm-arm/arch-rpc/uncompress.h 2005-09-10 03:42:58.000000000 +0100 +++ linux-2.6.13.1/include/asm-arm/arch-rpc/uncompress.h 2005-09-27 21:08:02.000000000 +0100 @@ -11,7 +11,9 @@ #include #include +#include +int video_ok = 0; int video_num_columns, video_num_lines, video_size_row; int white, bytes_per_char_h; extern unsigned long con_charconvtable[256]; @@ -74,6 +76,9 @@ unsigned char c; char *ptr; + /* Do nothing if we don't have video info */ + if (!video_ok) return; + x = params->video_x; y = params->video_y; @@ -107,6 +112,9 @@ static void arch_decomp_setup(void) { int i; + + /* Don't do video if we're passed a kernel tagged list */ + if (((struct tag_header *)params)->tag == ATAG_CORE) return; video_num_lines = params->video_num_rows; video_num_columns = params->video_num_cols; @@ -146,6 +155,8 @@ } if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n"); + + video_ok = 1; } #endif