File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1672,6 +1672,15 @@ int boot_linux_from_mmc(void)
16721672 return -1 ;
16731673 }
16741674
1675+ /* If lk2nd is installed on the mmc's boot partition,
1676+ * the device would repeat booting into lk2nd forever.
1677+ * Prevent this to happen.
1678+ */
1679+ if (strstr ((const char * )hdr -> cmdline , "lk2nd" )) {
1680+ dprintf (CRITICAL , "ERROR: lk2nd detected on partition %s\n" , ptn_name );
1681+ return ERR_REPEAT_BOOT_LK2ND ;
1682+ }
1683+
16751684 if (memcmp (hdr -> magic , BOOT_MAGIC , BOOT_MAGIC_SIZE )) {
16761685 dprintf (CRITICAL , "ERROR: Invalid boot image header\n" );
16771686 return ERR_INVALID_BOOT_MAGIC ;
@@ -5693,6 +5702,7 @@ void aboot_init(const struct app_descriptor *app)
56935702 case ERR_DT_PARSE :
56945703 case ERR_ABOOT_ADDR_OVERLAP :
56955704 case ERR_INVALID_BOOT_MAGIC :
5705+ case ERR_REPEAT_BOOT_LK2ND :
56965706 if (partition_multislot_is_supported ())
56975707 {
56985708 /*
Original file line number Diff line number Diff line change 235235 ERR_DECOMPRESSION ,
236236 ERR_DT_PARSE ,
237237 ERR_BOOT_SIGNATURE_MISMATCH ,
238+ ERR_REPEAT_BOOT_LK2ND ,
238239};
239240#endif
You can’t perform that action at this time.
0 commit comments