AArch64 EL2 hypervisor for QEMU virt that boots at EL2
1

Configure Feed

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

Validate Linux boot argument synthesis against DTB capacity

+22 -1
+19 -1
core/fdt.c
··· 525 525 return true; 526 526 } 527 527 528 + bool fdt_bootargs_valid(const char *bootargs) 529 + { 530 + size_t len = 0; 531 + if (bootargs == (const char *)0) { 532 + return true; 533 + } 534 + while (bootargs[len] != '\0') { 535 + if ((unsigned char)bootargs[len] < 0x20u || (unsigned char)bootargs[len] > 0x7eu) { 536 + return false; 537 + } 538 + len++; 539 + if (len >= FDT_BOOTARGS_MAX) { 540 + return false; 541 + } 542 + } 543 + return len != 0u; 544 + } 545 + 528 546 bool fdt_probe(uint64_t fdt_pa, struct fdt_platform_info *info) 529 547 { 530 548 const uint8_t *fdt = (const uint8_t *)(uintptr_t)fdt_pa; ··· 650 668 struct fdt_platform_info info; 651 669 bool ok = true; 652 670 653 - if (!fdt_probe(fdt_pa, &info)) { 671 + if (!fdt_bootargs_valid(bootargs) || !fdt_probe(fdt_pa, &info)) { 654 672 return false; 655 673 } 656 674 if (bootargs != (const char *)0) {
+3
include/hv/fdt.h
··· 3 3 4 4 #include "hv/types.h" 5 5 6 + #define FDT_BOOTARGS_MAX 256u 7 + 6 8 struct fdt_platform_info { 7 9 bool valid; 8 10 uint64_t fdt_pa; ··· 16 18 17 19 bool fdt_probe(uint64_t fdt_pa, struct fdt_platform_info *info); 18 20 bool fdt_patch_memory(uint64_t fdt_pa, uint64_t base, uint64_t size); 21 + bool fdt_bootargs_valid(const char *bootargs); 19 22 bool fdt_patch_linux_guest(uint64_t fdt_pa, uint64_t max_size, const char *bootargs, 20 23 uint64_t initrd_start, uint64_t initrd_end); 21 24 void fdt_dump(const struct fdt_platform_info *info);