Re: [PATCH v2] U-Boot crash on wandboard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-09-22 17:23, Steven Falco wrote:
Prevent a crash when PXE boot calls do_bootm with a vmlinuz formatted image. In this case, there will be a null cmdtp pointer, and we must not dereference
it.

Signed-off-by: Steven A. Falco <stevenfalco@xxxxxxxxx>

Hi Steven,

Thanks for looking into this and coming up with a patch, Ill pull it into the fedora package, could you also send it upstream.

Thanks

Dennis

---

In file cmd_pxe.c around line 697 is a call:

do_bootm(NULL, 0, bootm_argc, bootm_argv);

Notice that the first argument is NULL.  Therefore, the cmdtp
pointer will always be NULL when using the pxe boot mechanism.

do_bootm() eventually calls boot_get_kernel(), still with cmdtp == NULL. In the Wandboard case, the vmlinuz binary is not "legacy format", nor is
it "fit format", so U-Boot attempts to print:

printf("Wrong Image Format for %s command\n", cmdtp->name);

That is doomed to fail, because cmdtp is NULL. The following patch corrects the problem; the command name will be printed only if the pointer is valid.

diff -ur fedora-uboot.original/common/cmd_bootm.c
fedora-uboot/common/cmd_bootm.c
--- fedora-uboot.original/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400
+++ fedora-uboot/common/cmd_bootm.c	2013-09-22 17:57:48.903227965 -0400
@@ -997,7 +997,10 @@
 		break;
 #endif
 	default:
-		printf("Wrong Image Format for %s command\n", cmdtp->name);
+		if(cmdtp)
+			printf("Wrong Image Format for %s command\n", cmdtp->name);
+		else
+			printf("Wrong Image Format for command\n");
 		bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO);
 		return NULL;
 	}
_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm

_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM (Vger)]     [Linux ARM]     [ARM Kernel]     [Fedora User Discussion]     [Older Fedora Users Discussion]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Maintainers]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [Linux Apps]     [KDE Users]     [Fedora Tools]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

Powered by Linux