]> git.saurik.com Git - apple/xnu.git/blobdiff - san/kasan-x86_64.c
xnu-4903.231.4.tar.gz
[apple/xnu.git] / san / kasan-x86_64.c
index e2cb6d3bdd0beb85e1921a720a501498edd43436..4b685e67ff4f930d256b36223d8aec9c2968e4cd 100644 (file)
@@ -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);