X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/a39ff7e25e19b3a8c3020042a3872ca9ec9659f1..e8c3f78193f1895ea514044358b93b1add9322f3:/san/kasan-x86_64.c diff --git a/san/kasan-x86_64.c b/san/kasan-x86_64.c index e2cb6d3bd..4b685e67f 100644 --- a/san/kasan-x86_64.c +++ b/san/kasan-x86_64.c @@ -194,9 +194,12 @@ kasan_map_shadow_superpage_zero(vm_offset_t address, vm_size_t size) void kasan_map_shadow(vm_offset_t address, vm_size_t size, bool is_zero) { + size = (size + 0x7UL) & ~0x7UL; vm_offset_t shadow_base = vm_map_trunc_page(SHADOW_FOR_ADDRESS(address), PAGE_MASK); vm_offset_t shadow_top = vm_map_round_page(SHADOW_FOR_ADDRESS(address + size), PAGE_MASK); + assert((size & 0x7) == 0); + for (; shadow_base < shadow_top; shadow_base += I386_PGBYTES) { split_addr_t addr = split_address(shadow_base);