"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'u-boot-dfu-20250124' of https://source.denx.de/u-boot/custodians/u-boot-dfu

CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/24323

Android:
- Fix kcmdline null pointer dereference (reported by coverity and
multiple users)
- Move Igor to reviewers instead of maintainers for avb/ab
- Fix booting Android with AVB built-in, but disabled via
fastboot flash --disable-verity vbmeta vbmeta.img

+31 -20
+2 -2
MAINTAINERS
··· 66 66 F: test/lib/alist.c 67 67 68 68 ANDROID AB 69 - M: Igor Opaniuk <igor.opaniuk@gmail.com> 70 69 M: Mattijs Korpershoek <mkorpershoek@baylibre.com> 70 + R: Igor Opaniuk <igor.opaniuk@gmail.com> 71 71 R: Sam Protsenko <semen.protsenko@linaro.org> 72 72 S: Maintained 73 73 T: git https://source.denx.de/u-boot/custodians/u-boot-dfu.git ··· 77 77 F: test/py/tests/test_android/test_ab.py 78 78 79 79 ANDROID AVB 80 - M: Igor Opaniuk <igor.opaniuk@gmail.com> 81 80 M: Mattijs Korpershoek <mkorpershoek@baylibre.com> 81 + R: Igor Opaniuk <igor.opaniuk@gmail.com> 82 82 S: Maintained 83 83 T: git https://source.denx.de/u-boot/custodians/u-boot-dfu.git 84 84 F: cmd/avb.c
+25 -14
boot/bootmeth_android.c
··· 422 422 { 423 423 struct blk_desc *desc = dev_get_uclass_plat(bflow->blk); 424 424 struct android_priv *priv = bflow->bootmeth_priv; 425 - const char * const requested_partitions[] = {"boot", "vendor_boot"}; 425 + const char * const requested_partitions[] = {"boot", "vendor_boot", NULL}; 426 426 struct AvbOps *avb_ops; 427 427 AvbSlotVerifyResult result; 428 428 AvbSlotVerifyData *out_data; ··· 450 450 AVB_HASHTREE_ERROR_MODE_RESTART_AND_INVALIDATE, 451 451 &out_data); 452 452 453 - if (result != AVB_SLOT_VERIFY_RESULT_OK) { 454 - printf("Verification failed, reason: %s\n", 455 - str_avb_slot_error(result)); 456 - avb_slot_verify_data_free(out_data); 457 - return log_msg_ret("avb verify", -EIO); 453 + if (!unlocked) { 454 + /* When device is locked, we only accept AVB_SLOT_VERIFY_RESULT_OK */ 455 + if (result != AVB_SLOT_VERIFY_RESULT_OK) { 456 + printf("Verification failed, reason: %s\n", 457 + str_avb_slot_error(result)); 458 + avb_slot_verify_data_free(out_data); 459 + return log_msg_ret("avb verify", -EIO); 460 + } 461 + boot_state = AVB_GREEN; 462 + } else { 463 + /* When device is unlocked, we also accept verification errors */ 464 + if (result != AVB_SLOT_VERIFY_RESULT_OK && 465 + result != AVB_SLOT_VERIFY_RESULT_ERROR_VERIFICATION) { 466 + printf("Unlocked verification failed, reason: %s\n", 467 + str_avb_slot_error(result)); 468 + avb_slot_verify_data_free(out_data); 469 + return log_msg_ret("avb verify unlocked", -EIO); 470 + } 471 + boot_state = AVB_ORANGE; 458 472 } 459 473 460 - if (unlocked) 461 - boot_state = AVB_ORANGE; 462 - else 463 - boot_state = AVB_GREEN; 464 - 465 474 extra_args = avb_set_state(avb_ops, boot_state); 466 475 if (extra_args) { 467 476 /* extra_args will be modified after this. This is fine */ ··· 470 479 goto free_out_data; 471 480 } 472 481 473 - ret = avb_append_commandline(bflow, out_data->cmdline); 474 - if (ret < 0) 475 - goto free_out_data; 482 + if (result == AVB_SLOT_VERIFY_RESULT_OK) { 483 + ret = avb_append_commandline(bflow, out_data->cmdline); 484 + if (ret < 0) 485 + goto free_out_data; 486 + } 476 487 477 488 return 0; 478 489
+4 -4
boot/image-android.c
··· 337 337 if (bootargs) 338 338 len += strlen(bootargs); 339 339 340 - if (*img_data.kcmdline) { 340 + if (img_data.kcmdline && *img_data.kcmdline) { 341 341 printf("Kernel command line: %s\n", img_data.kcmdline); 342 342 len += strlen(img_data.kcmdline) + (len ? 1 : 0); /* +1 for extra space */ 343 343 } 344 344 345 - if (*img_data.kcmdline_extra) { 345 + if (img_data.kcmdline_extra && *img_data.kcmdline_extra) { 346 346 printf("Kernel extra command line: %s\n", img_data.kcmdline_extra); 347 347 len += strlen(img_data.kcmdline_extra) + (len ? 1 : 0); /* +1 for extra space */ 348 348 } ··· 357 357 if (bootargs) 358 358 strcpy(newbootargs, bootargs); 359 359 360 - if (*img_data.kcmdline) { 360 + if (img_data.kcmdline && *img_data.kcmdline) { 361 361 if (*newbootargs) /* If there is something in newbootargs, a space is needed */ 362 362 strcat(newbootargs, " "); 363 363 strcat(newbootargs, img_data.kcmdline); 364 364 } 365 365 366 - if (*img_data.kcmdline_extra) { 366 + if (img_data.kcmdline_extra && *img_data.kcmdline_extra) { 367 367 if (*newbootargs) /* If there is something in newbootargs, a space is needed */ 368 368 strcat(newbootargs, " "); 369 369 strcat(newbootargs, img_data.kcmdline_extra);