Lines Matching full:size
47 * depending on memory access size X.
63 unsigned long size) in memory_is_poisoned_2_4_8() argument
68 * Access crosses 8(shadow size)-byte boundary. Such access maps in memory_is_poisoned_2_4_8()
71 if (unlikely(((addr + size - 1) & KASAN_SHADOW_MASK) < size - 1)) in memory_is_poisoned_2_4_8()
72 return *shadow_addr || memory_is_poisoned_1(addr + size - 1); in memory_is_poisoned_2_4_8()
74 return memory_is_poisoned_1(addr + size - 1); in memory_is_poisoned_2_4_8()
89 size_t size) in bytes_is_nonzero() argument
91 while (size) { in bytes_is_nonzero()
95 size--; in bytes_is_nonzero()
131 size_t size) in memory_is_poisoned_n() argument
136 kasan_mem_to_shadow((void *)addr + size - 1) + 1); in memory_is_poisoned_n()
139 unsigned long last_byte = addr + size - 1; in memory_is_poisoned_n()
149 static __always_inline bool memory_is_poisoned(unsigned long addr, size_t size) in memory_is_poisoned() argument
151 if (__builtin_constant_p(size)) { in memory_is_poisoned()
152 switch (size) { in memory_is_poisoned()
158 return memory_is_poisoned_2_4_8(addr, size); in memory_is_poisoned()
166 return memory_is_poisoned_n(addr, size); in memory_is_poisoned()
170 size_t size, bool write, in check_memory_region_inline() argument
173 if (unlikely(size == 0)) in check_memory_region_inline()
178 kasan_report(addr, size, write, ret_ip); in check_memory_region_inline()
182 if (likely(!memory_is_poisoned(addr, size))) in check_memory_region_inline()
185 kasan_report(addr, size, write, ret_ip); in check_memory_region_inline()
189 bool check_memory_region(unsigned long addr, size_t size, bool write, in check_memory_region() argument
192 return check_memory_region_inline(addr, size, write, ret_ip); in check_memory_region()
208 size_t aligned_size = round_up(global->size, KASAN_SHADOW_SCALE_SIZE); in register_global()
210 kasan_unpoison_shadow(global->beg, global->size); in register_global()
217 void __asan_register_globals(struct kasan_global *globals, size_t size) in __asan_register_globals() argument
221 for (i = 0; i < size; i++) in __asan_register_globals()
226 void __asan_unregister_globals(struct kasan_global *globals, size_t size) in __asan_unregister_globals() argument
231 #define DEFINE_ASAN_LOAD_STORE(size) \ argument
232 void __asan_load##size(unsigned long addr) \
234 check_memory_region_inline(addr, size, false, _RET_IP_);\
236 EXPORT_SYMBOL(__asan_load##size); \
237 __alias(__asan_load##size) \
238 void __asan_load##size##_noabort(unsigned long); \
239 EXPORT_SYMBOL(__asan_load##size##_noabort); \
240 void __asan_store##size(unsigned long addr) \
242 check_memory_region_inline(addr, size, true, _RET_IP_); \
244 EXPORT_SYMBOL(__asan_store##size); \
245 __alias(__asan_store##size) \
246 void __asan_store##size##_noabort(unsigned long); \
247 EXPORT_SYMBOL(__asan_store##size##_noabort)
255 void __asan_loadN(unsigned long addr, size_t size) in __asan_loadN() argument
257 check_memory_region(addr, size, false, _RET_IP_); in __asan_loadN()
265 void __asan_storeN(unsigned long addr, size_t size) in __asan_storeN() argument
267 check_memory_region(addr, size, true, _RET_IP_); in __asan_storeN()
280 void __asan_alloca_poison(unsigned long addr, size_t size) in __asan_alloca_poison() argument
282 size_t rounded_up_size = round_up(size, KASAN_SHADOW_SCALE_SIZE); in __asan_alloca_poison()
283 size_t padding_size = round_up(size, KASAN_ALLOCA_REDZONE_SIZE) - in __asan_alloca_poison()
285 size_t rounded_down_size = round_down(size, KASAN_SHADOW_SCALE_SIZE); in __asan_alloca_poison()
294 size - rounded_down_size); in __asan_alloca_poison()
315 void __asan_set_shadow_##byte(const void *addr, size_t size) \
317 __memset((void *)addr, 0x##byte, size); \