On Mon, Dec 11, 2006 at 05:45:54PM +0530, Sachin P. Sant wrote: > Horms wrote: > >Fix propnames in kexec/arch/ppc64/fs2dt.c > > > >* Makes sure it is initialised as null terminated > >* Make sure it is not overrun when new elements are added > > > >Signed-off-by: Simon Horman <[EMAIL PROTECTED]> > > > Not sure if we really need the changes related to second bullet. This patch > creates problem during kdump boot and kdump > kernel fails to boot. Will need to find out the real reason > for failure. Probably the extra check is causing trouble ??
Hi, Thanks for testing my patch. I looked over it and some of the changes are indeed a bit bogus. Here is a simplier version. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ Fix propnames in kexec/arch/ppc64/fs2dt.c * Makes sure it is initialised as null terminated * Make sure it is not overrun when new elements are added Signed-off-by: Simon Horman <[EMAIL PROTECTED]> Index: kexec-tools-testing/kexec/arch/ppc64/fs2dt.c =================================================================== --- kexec-tools-testing.orig/kexec/arch/ppc64/fs2dt.c 2006-12-12 15:33:57.000000000 +0900 +++ kexec-tools-testing/kexec/arch/ppc64/fs2dt.c 2006-12-12 15:38:31.000000000 +0900 @@ -58,7 +58,7 @@ } static char pathname[MAXPATH], *pathstart; -static char propnames[NAMESPACE]; +static char propnames[NAMESPACE] = { 0 }; static unsigned dtstruct[TREEWORDS], *dt; static unsigned long long mem_rsrv[2*MEMRESERVE]; @@ -124,6 +124,9 @@ else return offset; + if (NAMESPACE - offset < strlen(name) + 1) + die("unrecoverable error: propnames overrun\n"); + strcpy(propnames+offset, name); return offset; _______________________________________________ fastboot mailing list [email protected] https://lists.osdl.org/mailman/listinfo/fastboot
