Lines Matching refs:ctx

51 static void asan_test_cleanup(struct asan_test_ctx *ctx)  in asan_test_cleanup()  argument
55 free(ctx->pmalloc1); in asan_test_cleanup()
57 for (; i < ARRAY_SIZE(ctx->pmalloc2); i++) in asan_test_cleanup()
58 free(ctx->pmalloc2[i]); in asan_test_cleanup()
61 void asan_test_stack(struct asan_test_ctx *ctx) in asan_test_stack() argument
65 ctx->write_func(buf, ASAN_TEST_BUF_SIZE, ctx->write_value); in asan_test_stack()
68 void asan_test_global_stat(struct asan_test_ctx *ctx) in asan_test_global_stat() argument
70 ctx->write_func(asan_test_sgbuf, ASAN_TEST_BUF_SIZE, in asan_test_global_stat()
71 ctx->write_value); in asan_test_global_stat()
74 void asan_test_global_ro(struct asan_test_ctx *ctx) in asan_test_global_ro() argument
76 ctx->read_func((char *)asan_test_sgbuf_ro, in asan_test_global_ro()
80 void asan_test_global(struct asan_test_ctx *ctx) in asan_test_global() argument
82 ctx->write_func(asan_test_gbuf, ASAN_TEST_BUF_SIZE, in asan_test_global()
83 ctx->write_value); in asan_test_global()
86 void asan_test_malloc(struct asan_test_ctx *ctx) in asan_test_malloc() argument
88 ctx->pmalloc1 = malloc(ASAN_TEST_BUF_SIZE); in asan_test_malloc()
90 if (ctx->pmalloc1) in asan_test_malloc()
91 ctx->write_func(ctx->pmalloc1, ASAN_TEST_BUF_SIZE, in asan_test_malloc()
92 ctx->write_value); in asan_test_malloc()
95 void asan_test_malloc2(struct asan_test_ctx *ctx) in asan_test_malloc2() argument
101 for (; i < ARRAY_SIZE(ctx->pmalloc2); i++) { in asan_test_malloc2()
102 ctx->pmalloc2[i] = malloc(aligned_size); in asan_test_malloc2()
103 if (!ctx->pmalloc2[i]) in asan_test_malloc2()
106 p = ctx->pmalloc2[1]; in asan_test_malloc2()
107 ctx->write_func(p, aligned_size, ctx->write_value); in asan_test_malloc2()
110 void asan_test_use_after_free(struct asan_test_ctx *ctx) in asan_test_use_after_free() argument
115 ctx->free_func(a); in asan_test_use_after_free()
116 ctx->write_func(a, 0, ctx->write_value); in asan_test_use_after_free()
120 void asan_test_memcpy_dst(struct asan_test_ctx *ctx) in asan_test_memcpy_dst() argument
125 ctx->memcpy_func(a, b, sizeof(b)); in asan_test_memcpy_dst()
128 void asan_test_memcpy_src(struct asan_test_ctx *ctx) in asan_test_memcpy_src() argument
133 ctx->memcpy_func(a, b, sizeof(a)); in asan_test_memcpy_src()
136 void asan_test_memset(struct asan_test_ctx *ctx) in asan_test_memset() argument
140 ctx->memset_func(b, ctx->write_value, ASAN_TEST_BUF_SIZE + 1); in asan_test_memset()
148 void asan_test_init(struct asan_test_ctx *ctx) in asan_test_init() argument
150 ctx->write_value = 0xab; in asan_test_init()
151 ctx->write_func = asan_out_of_bounds_write; in asan_test_init()
152 ctx->read_func = asan_out_of_bounds_read; in asan_test_init()
153 ctx->memcpy_func = asan_out_of_bounds_memcpy; in asan_test_init()
154 ctx->memset_func = asan_out_of_bounds_memset; in asan_test_init()
155 ctx->free_func = asan_test_free; in asan_test_init()
160 void asan_test_deinit(struct asan_test_ctx *ctx) in asan_test_deinit() argument
162 asan_test_cleanup(ctx); in asan_test_deinit()
166 int asan_call_test(struct asan_test_ctx *ctx, in asan_call_test() argument
167 void (*test)(struct asan_test_ctx *ctx), in asan_call_test() argument
174 test(ctx); in asan_call_test()