1 //===-asan_abi_shim.cpp - ASan Stable ABI Shim-----------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "../asan/asan_interface_internal.h"
10 #include "asan_abi.h"
11 #include <assert.h>
12
13 extern "C" {
14 // Functions concerning instrumented global variables
__asan_register_image_globals(uptr * flag)15 void __asan_register_image_globals(uptr *flag) {
16 __asan_abi_register_image_globals();
17 }
__asan_unregister_image_globals(uptr * flag)18 void __asan_unregister_image_globals(uptr *flag) {
19 __asan_abi_unregister_image_globals();
20 }
__asan_register_elf_globals(uptr * flag,void * start,void * stop)21 void __asan_register_elf_globals(uptr *flag, void *start, void *stop) {
22 bool bFlag = *flag;
23 __asan_abi_register_elf_globals(&bFlag, start, stop);
24 *flag = bFlag;
25 }
__asan_unregister_elf_globals(uptr * flag,void * start,void * stop)26 void __asan_unregister_elf_globals(uptr *flag, void *start, void *stop) {
27 bool bFlag = *flag;
28 __asan_abi_unregister_elf_globals(&bFlag, start, stop);
29 *flag = bFlag;
30 }
__asan_register_globals(__asan_global * globals,uptr n)31 void __asan_register_globals(__asan_global *globals, uptr n) {
32 __asan_abi_register_globals(globals, n);
33 }
__asan_unregister_globals(__asan_global * globals,uptr n)34 void __asan_unregister_globals(__asan_global *globals, uptr n) {
35 __asan_abi_unregister_globals(globals, n);
36 }
37
38 // Functions concerning dynamic library initialization
__asan_before_dynamic_init(const char * module_name)39 void __asan_before_dynamic_init(const char *module_name) {
40 __asan_abi_before_dynamic_init(module_name);
41 }
__asan_after_dynamic_init(void)42 void __asan_after_dynamic_init(void) { __asan_abi_after_dynamic_init(); }
43
44 // Functions concerning block memory destinations
__asan_memcpy(void * dst,const void * src,uptr size)45 void *__asan_memcpy(void *dst, const void *src, uptr size) {
46 return __asan_abi_memcpy(dst, src, size);
47 }
__asan_memset(void * s,int c,uptr n)48 void *__asan_memset(void *s, int c, uptr n) {
49 return __asan_abi_memset(s, c, n);
50 }
__asan_memmove(void * dest,const void * src,uptr n)51 void *__asan_memmove(void *dest, const void *src, uptr n) {
52 return __asan_abi_memmove(dest, src, n);
53 }
54
55 // Functions concerning RTL startup and initialization
__asan_init(void)56 void __asan_init(void) {
57 static_assert(sizeof(uptr) == 8 || sizeof(uptr) == 4);
58 static_assert(sizeof(u64) == 8);
59 static_assert(sizeof(u32) == 4);
60
61 __asan_abi_init();
62 }
63
__asan_handle_no_return(void)64 void __asan_handle_no_return(void) { __asan_abi_handle_no_return(); }
65
66 // Variables concerning RTL state. These provisionally exist for completeness
67 // but will likely move into the Stable ABI implementation and not in the shim.
68 uptr __asan_shadow_memory_dynamic_address = (uptr)0L;
69 int __asan_option_detect_stack_use_after_return = 1;
70
71 // Functions concerning memory load and store reporting
__asan_report_load1(uptr addr)72 void __asan_report_load1(uptr addr) {
73 __asan_abi_report_load_n((void *)addr, 1, true);
74 }
__asan_report_load2(uptr addr)75 void __asan_report_load2(uptr addr) {
76 __asan_abi_report_load_n((void *)addr, 2, true);
77 }
__asan_report_load4(uptr addr)78 void __asan_report_load4(uptr addr) {
79 __asan_abi_report_load_n((void *)addr, 4, true);
80 }
__asan_report_load8(uptr addr)81 void __asan_report_load8(uptr addr) {
82 __asan_abi_report_load_n((void *)addr, 8, true);
83 }
__asan_report_load16(uptr addr)84 void __asan_report_load16(uptr addr) {
85 __asan_abi_report_load_n((void *)addr, 16, true);
86 }
__asan_report_load_n(uptr addr,uptr size)87 void __asan_report_load_n(uptr addr, uptr size) {
88 __asan_abi_report_load_n((void *)addr, size, true);
89 }
__asan_report_store1(uptr addr)90 void __asan_report_store1(uptr addr) {
91 __asan_abi_report_store_n((void *)addr, 1, true);
92 }
__asan_report_store2(uptr addr)93 void __asan_report_store2(uptr addr) {
94 __asan_abi_report_store_n((void *)addr, 2, true);
95 }
__asan_report_store4(uptr addr)96 void __asan_report_store4(uptr addr) {
97 __asan_abi_report_store_n((void *)addr, 4, true);
98 }
__asan_report_store8(uptr addr)99 void __asan_report_store8(uptr addr) {
100 __asan_abi_report_store_n((void *)addr, 8, true);
101 }
__asan_report_store16(uptr addr)102 void __asan_report_store16(uptr addr) {
103 __asan_abi_report_store_n((void *)addr, 16, true);
104 }
__asan_report_store_n(uptr addr,uptr size)105 void __asan_report_store_n(uptr addr, uptr size) {
106 __asan_abi_report_store_n((void *)addr, size, true);
107 }
108
109 // Functions concerning memory load and store reporting (experimental variants)
__asan_report_exp_load1(uptr addr,u32 exp)110 void __asan_report_exp_load1(uptr addr, u32 exp) {
111 __asan_abi_report_exp_load_n((void *)addr, exp, 1, true);
112 }
__asan_report_exp_load2(uptr addr,u32 exp)113 void __asan_report_exp_load2(uptr addr, u32 exp) {
114 __asan_abi_report_exp_load_n((void *)addr, exp, 2, true);
115 }
__asan_report_exp_load4(uptr addr,u32 exp)116 void __asan_report_exp_load4(uptr addr, u32 exp) {
117 __asan_abi_report_exp_load_n((void *)addr, exp, 4, true);
118 }
__asan_report_exp_load8(uptr addr,u32 exp)119 void __asan_report_exp_load8(uptr addr, u32 exp) {
120 __asan_abi_report_exp_load_n((void *)addr, exp, 8, true);
121 }
__asan_report_exp_load16(uptr addr,u32 exp)122 void __asan_report_exp_load16(uptr addr, u32 exp) {
123 __asan_abi_report_exp_load_n((void *)addr, exp, 16, true);
124 }
__asan_report_exp_load_n(uptr addr,uptr size,u32 exp)125 void __asan_report_exp_load_n(uptr addr, uptr size, u32 exp) {
126 __asan_abi_report_exp_load_n((void *)addr, size, exp, true);
127 }
__asan_report_exp_store1(uptr addr,u32 exp)128 void __asan_report_exp_store1(uptr addr, u32 exp) {
129 __asan_abi_report_exp_store_n((void *)addr, exp, 1, true);
130 }
__asan_report_exp_store2(uptr addr,u32 exp)131 void __asan_report_exp_store2(uptr addr, u32 exp) {
132 __asan_abi_report_exp_store_n((void *)addr, exp, 2, true);
133 }
__asan_report_exp_store4(uptr addr,u32 exp)134 void __asan_report_exp_store4(uptr addr, u32 exp) {
135 __asan_abi_report_exp_store_n((void *)addr, exp, 4, true);
136 }
__asan_report_exp_store8(uptr addr,u32 exp)137 void __asan_report_exp_store8(uptr addr, u32 exp) {
138 __asan_abi_report_exp_store_n((void *)addr, exp, 8, true);
139 }
__asan_report_exp_store16(uptr addr,u32 exp)140 void __asan_report_exp_store16(uptr addr, u32 exp) {
141 __asan_abi_report_exp_store_n((void *)addr, exp, 16, true);
142 }
__asan_report_exp_store_n(uptr addr,uptr size,u32 exp)143 void __asan_report_exp_store_n(uptr addr, uptr size, u32 exp) {
144 __asan_abi_report_exp_store_n((void *)addr, size, exp, true);
145 }
146
147 // Functions concerning memory load and store reporting (noabort variants)
__asan_report_load1_noabort(uptr addr)148 void __asan_report_load1_noabort(uptr addr) {
149 __asan_abi_report_load_n((void *)addr, 1, false);
150 }
__asan_report_load2_noabort(uptr addr)151 void __asan_report_load2_noabort(uptr addr) {
152 __asan_abi_report_load_n((void *)addr, 2, false);
153 }
__asan_report_load4_noabort(uptr addr)154 void __asan_report_load4_noabort(uptr addr) {
155 __asan_abi_report_load_n((void *)addr, 4, false);
156 }
__asan_report_load8_noabort(uptr addr)157 void __asan_report_load8_noabort(uptr addr) {
158 __asan_abi_report_load_n((void *)addr, 8, false);
159 }
__asan_report_load16_noabort(uptr addr)160 void __asan_report_load16_noabort(uptr addr) {
161 __asan_abi_report_load_n((void *)addr, 16, false);
162 }
__asan_report_load_n_noabort(uptr addr,uptr size)163 void __asan_report_load_n_noabort(uptr addr, uptr size) {
164 __asan_abi_report_load_n((void *)addr, size, false);
165 }
__asan_report_store1_noabort(uptr addr)166 void __asan_report_store1_noabort(uptr addr) {
167 __asan_abi_report_store_n((void *)addr, 1, false);
168 }
__asan_report_store2_noabort(uptr addr)169 void __asan_report_store2_noabort(uptr addr) {
170 __asan_abi_report_store_n((void *)addr, 2, false);
171 }
__asan_report_store4_noabort(uptr addr)172 void __asan_report_store4_noabort(uptr addr) {
173 __asan_abi_report_store_n((void *)addr, 4, false);
174 }
__asan_report_store8_noabort(uptr addr)175 void __asan_report_store8_noabort(uptr addr) {
176 __asan_abi_report_store_n((void *)addr, 8, false);
177 }
__asan_report_store16_noabort(uptr addr)178 void __asan_report_store16_noabort(uptr addr) {
179 __asan_abi_report_store_n((void *)addr, 16, false);
180 }
__asan_report_store_n_noabort(uptr addr,uptr size)181 void __asan_report_store_n_noabort(uptr addr, uptr size) {
182 __asan_abi_report_store_n((void *)addr, size, false);
183 }
184
185 // Functions concerning memory load and store
__asan_load1(uptr addr)186 void __asan_load1(uptr addr) { __asan_abi_load_n((void *)addr, 1, true); }
__asan_load2(uptr addr)187 void __asan_load2(uptr addr) { __asan_abi_load_n((void *)addr, 2, true); }
__asan_load4(uptr addr)188 void __asan_load4(uptr addr) { __asan_abi_load_n((void *)addr, 4, true); }
__asan_load8(uptr addr)189 void __asan_load8(uptr addr) { __asan_abi_load_n((void *)addr, 8, true); }
__asan_load16(uptr addr)190 void __asan_load16(uptr addr) { __asan_abi_load_n((void *)addr, 16, true); }
__asan_loadN(uptr addr,uptr size)191 void __asan_loadN(uptr addr, uptr size) {
192 __asan_abi_load_n((void *)addr, size, true);
193 }
__asan_store1(uptr addr)194 void __asan_store1(uptr addr) { __asan_abi_store_n((void *)addr, 1, true); }
__asan_store2(uptr addr)195 void __asan_store2(uptr addr) { __asan_abi_store_n((void *)addr, 2, true); }
__asan_store4(uptr addr)196 void __asan_store4(uptr addr) { __asan_abi_store_n((void *)addr, 4, true); }
__asan_store8(uptr addr)197 void __asan_store8(uptr addr) { __asan_abi_store_n((void *)addr, 8, true); }
__asan_store16(uptr addr)198 void __asan_store16(uptr addr) { __asan_abi_store_n((void *)addr, 16, true); }
__asan_storeN(uptr addr,uptr size)199 void __asan_storeN(uptr addr, uptr size) {
200 __asan_abi_store_n((void *)addr, size, true);
201 }
202
203 // Functions concerning memory load and store (experimental variants)
__asan_exp_load1(uptr addr,u32 exp)204 void __asan_exp_load1(uptr addr, u32 exp) {
205 __asan_abi_exp_load_n((void *)addr, 1, exp, true);
206 }
__asan_exp_load2(uptr addr,u32 exp)207 void __asan_exp_load2(uptr addr, u32 exp) {
208 __asan_abi_exp_load_n((void *)addr, 2, exp, true);
209 }
__asan_exp_load4(uptr addr,u32 exp)210 void __asan_exp_load4(uptr addr, u32 exp) {
211 __asan_abi_exp_load_n((void *)addr, 4, exp, true);
212 }
__asan_exp_load8(uptr addr,u32 exp)213 void __asan_exp_load8(uptr addr, u32 exp) {
214 __asan_abi_exp_load_n((void *)addr, 8, exp, true);
215 }
__asan_exp_load16(uptr addr,u32 exp)216 void __asan_exp_load16(uptr addr, u32 exp) {
217 __asan_abi_exp_load_n((void *)addr, 16, exp, true);
218 }
__asan_exp_loadN(uptr addr,uptr size,u32 exp)219 void __asan_exp_loadN(uptr addr, uptr size, u32 exp) {
220 __asan_abi_exp_load_n((void *)addr, size, exp, true);
221 }
__asan_exp_store1(uptr addr,u32 exp)222 void __asan_exp_store1(uptr addr, u32 exp) {
223 __asan_abi_exp_store_n((void *)addr, 1, exp, true);
224 }
__asan_exp_store2(uptr addr,u32 exp)225 void __asan_exp_store2(uptr addr, u32 exp) {
226 __asan_abi_exp_store_n((void *)addr, 2, exp, true);
227 }
__asan_exp_store4(uptr addr,u32 exp)228 void __asan_exp_store4(uptr addr, u32 exp) {
229 __asan_abi_exp_store_n((void *)addr, 4, exp, true);
230 }
__asan_exp_store8(uptr addr,u32 exp)231 void __asan_exp_store8(uptr addr, u32 exp) {
232 __asan_abi_exp_store_n((void *)addr, 8, exp, true);
233 }
__asan_exp_store16(uptr addr,u32 exp)234 void __asan_exp_store16(uptr addr, u32 exp) {
235 __asan_abi_exp_store_n((void *)addr, 16, exp, true);
236 }
__asan_exp_storeN(uptr addr,uptr size,u32 exp)237 void __asan_exp_storeN(uptr addr, uptr size, u32 exp) {
238 __asan_abi_exp_store_n((void *)addr, size, exp, true);
239 }
240
241 // Functions concerning memory load and store (noabort variants)
__asan_load1_noabort(uptr addr)242 void __asan_load1_noabort(uptr addr) {
243 __asan_abi_load_n((void *)addr, 1, false);
244 }
__asan_load2_noabort(uptr addr)245 void __asan_load2_noabort(uptr addr) {
246 __asan_abi_load_n((void *)addr, 2, false);
247 }
__asan_load4_noabort(uptr addr)248 void __asan_load4_noabort(uptr addr) {
249 __asan_abi_load_n((void *)addr, 4, false);
250 }
__asan_load8_noabort(uptr addr)251 void __asan_load8_noabort(uptr addr) {
252 __asan_abi_load_n((void *)addr, 8, false);
253 }
__asan_load16_noabort(uptr addr)254 void __asan_load16_noabort(uptr addr) {
255 __asan_abi_load_n((void *)addr, 16, false);
256 }
__asan_loadN_noabort(uptr addr,uptr size)257 void __asan_loadN_noabort(uptr addr, uptr size) {
258 __asan_abi_load_n((void *)addr, size, false);
259 }
__asan_store1_noabort(uptr addr)260 void __asan_store1_noabort(uptr addr) {
261 __asan_abi_store_n((void *)addr, 1, false);
262 }
__asan_store2_noabort(uptr addr)263 void __asan_store2_noabort(uptr addr) {
264 __asan_abi_store_n((void *)addr, 2, false);
265 }
__asan_store4_noabort(uptr addr)266 void __asan_store4_noabort(uptr addr) {
267 __asan_abi_store_n((void *)addr, 4, false);
268 }
__asan_store8_noabort(uptr addr)269 void __asan_store8_noabort(uptr addr) {
270 __asan_abi_store_n((void *)addr, 8, false);
271 }
__asan_store16_noabort(uptr addr)272 void __asan_store16_noabort(uptr addr) {
273 __asan_abi_store_n((void *)addr, 16, false);
274 }
__asan_storeN_noabort(uptr addr,uptr size)275 void __asan_storeN_noabort(uptr addr, uptr size) {
276 __asan_abi_store_n((void *)addr, size, false);
277 }
278
279 // Functions concerning query about whether memory is poisoned
__asan_address_is_poisoned(void const volatile * addr)280 int __asan_address_is_poisoned(void const volatile *addr) {
281 return __asan_abi_address_is_poisoned(addr);
282 }
__asan_region_is_poisoned(uptr beg,uptr size)283 uptr __asan_region_is_poisoned(uptr beg, uptr size) {
284 return (uptr)__asan_abi_region_is_poisoned((void *)beg, size);
285 }
286
287 // Functions concerning the poisoning of memory
__asan_poison_memory_region(void const volatile * addr,uptr size)288 void __asan_poison_memory_region(void const volatile *addr, uptr size) {
289 __asan_abi_poison_memory_region(addr, size);
290 }
__asan_unpoison_memory_region(void const volatile * addr,uptr size)291 void __asan_unpoison_memory_region(void const volatile *addr, uptr size) {
292 __asan_abi_unpoison_memory_region(addr, size);
293 }
294
295 // Functions concerning the partial poisoning of memory
__asan_set_shadow_00(uptr addr,uptr size)296 void __asan_set_shadow_00(uptr addr, uptr size) {
297 __asan_abi_set_shadow_xx_n((void *)addr, 0x00, size);
298 }
__asan_set_shadow_01(uptr addr,uptr size)299 void __asan_set_shadow_01(uptr addr, uptr size) {
300 __asan_abi_set_shadow_xx_n((void *)addr, 0x01, size);
301 }
__asan_set_shadow_02(uptr addr,uptr size)302 void __asan_set_shadow_02(uptr addr, uptr size) {
303 __asan_abi_set_shadow_xx_n((void *)addr, 0x02, size);
304 }
__asan_set_shadow_03(uptr addr,uptr size)305 void __asan_set_shadow_03(uptr addr, uptr size) {
306 __asan_abi_set_shadow_xx_n((void *)addr, 0x03, size);
307 }
__asan_set_shadow_04(uptr addr,uptr size)308 void __asan_set_shadow_04(uptr addr, uptr size) {
309 __asan_abi_set_shadow_xx_n((void *)addr, 0x04, size);
310 }
__asan_set_shadow_05(uptr addr,uptr size)311 void __asan_set_shadow_05(uptr addr, uptr size) {
312 __asan_abi_set_shadow_xx_n((void *)addr, 0x05, size);
313 }
__asan_set_shadow_06(uptr addr,uptr size)314 void __asan_set_shadow_06(uptr addr, uptr size) {
315 __asan_abi_set_shadow_xx_n((void *)addr, 0x06, size);
316 }
__asan_set_shadow_07(uptr addr,uptr size)317 void __asan_set_shadow_07(uptr addr, uptr size) {
318 __asan_abi_set_shadow_xx_n((void *)addr, 0x07, size);
319 }
__asan_set_shadow_f1(uptr addr,uptr size)320 void __asan_set_shadow_f1(uptr addr, uptr size) {
321 __asan_abi_set_shadow_xx_n((void *)addr, 0xf1, size);
322 }
__asan_set_shadow_f2(uptr addr,uptr size)323 void __asan_set_shadow_f2(uptr addr, uptr size) {
324 __asan_abi_set_shadow_xx_n((void *)addr, 0xf2, size);
325 }
__asan_set_shadow_f3(uptr addr,uptr size)326 void __asan_set_shadow_f3(uptr addr, uptr size) {
327 __asan_abi_set_shadow_xx_n((void *)addr, 0xf3, size);
328 }
__asan_set_shadow_f5(uptr addr,uptr size)329 void __asan_set_shadow_f5(uptr addr, uptr size) {
330 __asan_abi_set_shadow_xx_n((void *)addr, 0xf5, size);
331 }
__asan_set_shadow_f8(uptr addr,uptr size)332 void __asan_set_shadow_f8(uptr addr, uptr size) {
333 __asan_abi_set_shadow_xx_n((void *)addr, 0xf8, size);
334 }
335
336 // Functions concerning stack poisoning
__asan_poison_stack_memory(uptr addr,uptr size)337 void __asan_poison_stack_memory(uptr addr, uptr size) {
338 __asan_abi_poison_stack_memory((void *)addr, size);
339 }
__asan_unpoison_stack_memory(uptr addr,uptr size)340 void __asan_unpoison_stack_memory(uptr addr, uptr size) {
341 __asan_abi_unpoison_stack_memory((void *)addr, size);
342 }
343
344 // Functions concerning redzone poisoning
__asan_poison_intra_object_redzone(uptr p,uptr size)345 void __asan_poison_intra_object_redzone(uptr p, uptr size) {
346 __asan_abi_poison_intra_object_redzone((void *)p, size);
347 }
__asan_unpoison_intra_object_redzone(uptr p,uptr size)348 void __asan_unpoison_intra_object_redzone(uptr p, uptr size) {
349 __asan_abi_unpoison_intra_object_redzone((void *)p, size);
350 }
351
352 // Functions concerning array cookie poisoning
__asan_poison_cxx_array_cookie(uptr p)353 void __asan_poison_cxx_array_cookie(uptr p) {
354 __asan_abi_poison_cxx_array_cookie((void *)p);
355 }
__asan_load_cxx_array_cookie(uptr * p)356 uptr __asan_load_cxx_array_cookie(uptr *p) {
357 return (uptr)__asan_abi_load_cxx_array_cookie((void **)p);
358 }
359
360 // Functions concerning fake stacks
__asan_get_current_fake_stack(void)361 void *__asan_get_current_fake_stack(void) {
362 return __asan_abi_get_current_fake_stack();
363 }
__asan_addr_is_in_fake_stack(void * fake_stack,void * addr,void ** beg,void ** end)364 void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg,
365 void **end) {
366 return __asan_abi_addr_is_in_fake_stack(fake_stack, addr, beg, end);
367 }
368
369 // Functions concerning poisoning and unpoisoning fake stack alloca
__asan_alloca_poison(uptr addr,uptr size)370 void __asan_alloca_poison(uptr addr, uptr size) {
371 __asan_abi_alloca_poison((void *)addr, size);
372 }
__asan_allocas_unpoison(uptr top,uptr bottom)373 void __asan_allocas_unpoison(uptr top, uptr bottom) {
374 __asan_abi_allocas_unpoison((void *)top, (void *)bottom);
375 }
376
377 // Functions concerning fake stack malloc
__asan_stack_malloc_0(uptr size)378 uptr __asan_stack_malloc_0(uptr size) {
379 return (uptr)__asan_abi_stack_malloc_n(0, size);
380 }
__asan_stack_malloc_1(uptr size)381 uptr __asan_stack_malloc_1(uptr size) {
382 return (uptr)__asan_abi_stack_malloc_n(1, size);
383 }
__asan_stack_malloc_2(uptr size)384 uptr __asan_stack_malloc_2(uptr size) {
385 return (uptr)__asan_abi_stack_malloc_n(2, size);
386 }
__asan_stack_malloc_3(uptr size)387 uptr __asan_stack_malloc_3(uptr size) {
388 return (uptr)__asan_abi_stack_malloc_n(3, size);
389 }
__asan_stack_malloc_4(uptr size)390 uptr __asan_stack_malloc_4(uptr size) {
391 return (uptr)__asan_abi_stack_malloc_n(4, size);
392 }
__asan_stack_malloc_5(uptr size)393 uptr __asan_stack_malloc_5(uptr size) {
394 return (uptr)__asan_abi_stack_malloc_n(5, size);
395 }
__asan_stack_malloc_6(uptr size)396 uptr __asan_stack_malloc_6(uptr size) {
397 return (uptr)__asan_abi_stack_malloc_n(6, size);
398 }
__asan_stack_malloc_7(uptr size)399 uptr __asan_stack_malloc_7(uptr size) {
400 return (uptr)__asan_abi_stack_malloc_n(7, size);
401 }
__asan_stack_malloc_8(uptr size)402 uptr __asan_stack_malloc_8(uptr size) {
403 return (uptr)__asan_abi_stack_malloc_n(8, size);
404 }
__asan_stack_malloc_9(uptr size)405 uptr __asan_stack_malloc_9(uptr size) {
406 return (uptr)__asan_abi_stack_malloc_n(9, size);
407 }
__asan_stack_malloc_10(uptr size)408 uptr __asan_stack_malloc_10(uptr size) {
409 return (uptr)__asan_abi_stack_malloc_n(10, size);
410 }
411
412 // Functions concerning fake stack malloc (always variants)
__asan_stack_malloc_always_0(uptr size)413 uptr __asan_stack_malloc_always_0(uptr size) {
414 return (uptr)__asan_abi_stack_malloc_always_n(0, size);
415 }
__asan_stack_malloc_always_1(uptr size)416 uptr __asan_stack_malloc_always_1(uptr size) {
417 return (uptr)__asan_abi_stack_malloc_always_n(1, size);
418 }
__asan_stack_malloc_always_2(uptr size)419 uptr __asan_stack_malloc_always_2(uptr size) {
420 return (uptr)__asan_abi_stack_malloc_always_n(2, size);
421 }
__asan_stack_malloc_always_3(uptr size)422 uptr __asan_stack_malloc_always_3(uptr size) {
423 return (uptr)__asan_abi_stack_malloc_always_n(3, size);
424 }
__asan_stack_malloc_always_4(uptr size)425 uptr __asan_stack_malloc_always_4(uptr size) {
426 return (uptr)__asan_abi_stack_malloc_always_n(4, size);
427 }
__asan_stack_malloc_always_5(uptr size)428 uptr __asan_stack_malloc_always_5(uptr size) {
429 return (uptr)__asan_abi_stack_malloc_always_n(5, size);
430 }
__asan_stack_malloc_always_6(uptr size)431 uptr __asan_stack_malloc_always_6(uptr size) {
432 return (uptr)__asan_abi_stack_malloc_always_n(6, size);
433 }
__asan_stack_malloc_always_7(uptr size)434 uptr __asan_stack_malloc_always_7(uptr size) {
435 return (uptr)__asan_abi_stack_malloc_always_n(7, size);
436 }
__asan_stack_malloc_always_8(uptr size)437 uptr __asan_stack_malloc_always_8(uptr size) {
438 return (uptr)__asan_abi_stack_malloc_always_n(8, size);
439 }
__asan_stack_malloc_always_9(uptr size)440 uptr __asan_stack_malloc_always_9(uptr size) {
441 return (uptr)__asan_abi_stack_malloc_always_n(9, size);
442 }
__asan_stack_malloc_always_10(uptr size)443 uptr __asan_stack_malloc_always_10(uptr size) {
444 return (uptr)__asan_abi_stack_malloc_always_n(10, size);
445 }
446
447 // Functions concerning fake stack free
__asan_stack_free_0(uptr ptr,uptr size)448 void __asan_stack_free_0(uptr ptr, uptr size) {
449 __asan_abi_stack_free_n(0, (void *)ptr, size);
450 }
__asan_stack_free_1(uptr ptr,uptr size)451 void __asan_stack_free_1(uptr ptr, uptr size) {
452 __asan_abi_stack_free_n(1, (void *)ptr, size);
453 }
__asan_stack_free_2(uptr ptr,uptr size)454 void __asan_stack_free_2(uptr ptr, uptr size) {
455 __asan_abi_stack_free_n(2, (void *)ptr, size);
456 }
__asan_stack_free_3(uptr ptr,uptr size)457 void __asan_stack_free_3(uptr ptr, uptr size) {
458 __asan_abi_stack_free_n(3, (void *)ptr, size);
459 }
__asan_stack_free_4(uptr ptr,uptr size)460 void __asan_stack_free_4(uptr ptr, uptr size) {
461 __asan_abi_stack_free_n(4, (void *)ptr, size);
462 }
__asan_stack_free_5(uptr ptr,uptr size)463 void __asan_stack_free_5(uptr ptr, uptr size) {
464 __asan_abi_stack_free_n(5, (void *)ptr, size);
465 }
__asan_stack_free_6(uptr ptr,uptr size)466 void __asan_stack_free_6(uptr ptr, uptr size) {
467 __asan_abi_stack_free_n(6, (void *)ptr, size);
468 }
__asan_stack_free_7(uptr ptr,uptr size)469 void __asan_stack_free_7(uptr ptr, uptr size) {
470 __asan_abi_stack_free_n(7, (void *)ptr, size);
471 }
__asan_stack_free_8(uptr ptr,uptr size)472 void __asan_stack_free_8(uptr ptr, uptr size) {
473 __asan_abi_stack_free_n(8, (void *)ptr, size);
474 }
__asan_stack_free_9(uptr ptr,uptr size)475 void __asan_stack_free_9(uptr ptr, uptr size) {
476 __asan_abi_stack_free_n(9, (void *)ptr, size);
477 }
__asan_stack_free_10(uptr ptr,uptr size)478 void __asan_stack_free_10(uptr ptr, uptr size) {
479 __asan_abi_stack_free_n(10, (void *)ptr, size);
480 }
481 }
482