[ubsan] fix some bugs and warnings discovered by ubsan
- X86 cpuid feature list dump was using the wrong array and walking off the end of one. - GICv2 code had a left shift by up to 31 of an integer. Needs to be unsigned. - PLIC same as GIC code. - fdtwalker code should be using a bytewise accessor based helper function for reading large integers out of an unaliged FDT. - PCI BIOS32 search code could do a 32bit unaligned read of a string, switch to using memcmp.
This commit is contained in:
@@ -82,7 +82,7 @@ static pci_bios_info *find_pci_bios_info(void) {
|
||||
uint i;
|
||||
|
||||
while (head < (uint32_t *) (0x000ffff0 + KERNEL_BASE)) {
|
||||
if (*head == *(uint32_t *) pci_bios_magic) {
|
||||
if (memcmp(head, pci_bios_magic, sizeof(pci_bios_magic)) == 0) {
|
||||
// perform the checksum
|
||||
sum = 0;
|
||||
b = (int8_t *) head;
|
||||
|
||||
Reference in New Issue
Block a user