The tests load_aout_direct and load_elf_direct only check the return values of the load functions:
|
/* Load a kernel with a valid a.out kludge */ |
|
ATF_CHECK(fread(random_buffer, 128*kiB, 1, urandom)); |
|
mbh = (struct multiboot_header* )(random_buffer + 2*kiB); |
|
mbh->magic = MULTIBOOT1_MAGIC; |
|
mbh->flags = 0 | MULTIBOOT_AOUT_KLUDGE; |
|
mbh->checksum = (uint32_t) 0U-MULTIBOOT1_MAGIC-(mbh->flags); |
|
mbh->header_addr = 1*MiB; |
|
mbh->load_addr = 1*MiB; |
|
mbh->load_end_addr = 1*MiB + 0x100; |
|
mbh->bss_end_addr = 1*MiB + 0x200; |
|
mbh->entry_addr = 1*MiB + sizeof(struct multiboot_header); |
|
|
|
mb = mb_scan(random_buffer, 128*kiB); |
|
error = multiboot_load_aout(random_buffer, 128*kiB, mbh); |
|
ATF_CHECK_EQ_MSG(0, error, "multiboot_load_aout failed"); |
|
mb = mb_scan(kernel, kernsz); |
|
mbh = mb->info.mb.header; |
|
multiboot_load_type(kernel, kernsz, &kernelf, mbh); |
|
error = multiboot_load_elf(kernel, kernsz, kernelf); |
|
ATF_CHECK_EQ_MSG(0, error, "multiboot_load_elf failed"); |
Instead they should also verify that copyin actually copied something. Probably the best idea is to
The tests
load_aout_directandload_elf_directonly check the return values of the load functions:bhyve-multiboot/tests/test-multiboot.c
Lines 214 to 228 in 63cc3d7
bhyve-multiboot/tests/test-multiboot.c
Lines 302 to 306 in 63cc3d7
Instead they should also verify that
copyinactually copied something. Probably the best idea is tolowmem_bufferandhighmem_bufferpointers frommock_bhyveload.c