Skip to contentSkip to conversation

fastboot: common: fix default fastboot_boot on 64-bit

PATCH New Neil Armstrong 2 participants 2 messages Feb 20, 2019 – Feb 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fastboot: common: fix default fastboot_boot on 64-bit

When booting on a 64-bit system, the boot_addr_start buffer is not large enough to contain a 64-bit number, thus leading to a crash even if fastboot_buf_addr is valid, only the high part of the address will be printed to boot_addr_start :

fastboot with fastboot_buf_addr = 0x0000000006000000:
downloading of 92239872 bytes finished Booting kernel at 0x00000000...

"Synchronous Abort" handler, esr 0x96000004
elr: 00000000010561f4 lr : 0000000001056fac (reloc) <snip>
x28: 000000007df2d38f x29: 000000007df2d1b0

Resetting CPU ...

With this fix, boot_addr_start can have the full 64-bit address passed to bootm.

Fixes f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot")
Cc Simon Glass <[email protected]>
Cc Alex Kiernan <[email protected]>
Cc Sam Protsenko <[email protected]>
---
 drivers/fastboot/fb_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fastboot/fb_common.c +1 -1
index c6e06aab7a..17eca73be0 100644
@@ -119,7 +119,7 @@ void fastboot_boot(void)
 	if (s) {
 		run_command(s, CMD_FLAG_ENV);
 	} else {
-		static char boot_addr_start[12];
+		static char boot_addr_start[20];
 		static char *const bootm_args[] = {
 			"bootm", boot_addr_start, NULL
 		};
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 fastboot: common: fix default fastboot_boot on 64-bit

Quoted 20 lines · Neil Armstrong

When booting on a 64-bit system, the boot_addr_start buffer is not large enough to contain a 64-bit number, thus leading to a crash even if fastboot_buf_addr is valid, only the high part of the address will be printed to boot_addr_start :

fastboot with fastboot_buf_addr = 0x0000000006000000:
downloading of 92239872 bytes finished Booting kernel at 0x00000000...

"Synchronous Abort" handler, esr 0x96000004
elr: 00000000010561f4 lr : 0000000001056fac (reloc) <snip>
x28: 000000007df2d38f x29: 000000007df2d1b0

Resetting CPU ...

With this fix, boot_addr_start can have the full 64-bit address passed to bootm.

Quoted 8 lines
Fixes f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot")
Cc Simon Glass <[email protected]>
Cc Alex Kiernan <[email protected]>
Cc Sam Protsenko <[email protected]>
---
 drivers/fastboot/fb_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)