27 HOST_WIDE_INT *,
tree *,
int);
80#define ASAN_SHADOW_SHIFT 3
81#define ASAN_SHADOW_GRANULARITY (1UL << ASAN_SHADOW_SHIFT)
85#define ASAN_RED_ZONE_SIZE 32
90#define ASAN_MIN_RED_ZONE_SIZE 16
98#define ASAN_STACK_MAGIC_LEFT 0xf1
99#define ASAN_STACK_MAGIC_MIDDLE 0xf2
100#define ASAN_STACK_MAGIC_RIGHT 0xf3
101#define ASAN_STACK_MAGIC_USE_AFTER_RET 0xf5
102#define ASAN_STACK_MAGIC_USE_AFTER_SCOPE 0xf8
104#define ASAN_STACK_FRAME_MAGIC 0x41b58ab3
105#define ASAN_STACK_RETIRED_MAGIC 0x45e0360e
107#define ASAN_USE_AFTER_SCOPE_ATTRIBUTE "use after scope memory"
114#define HWASAN_TAG_SIZE targetm.memtag.tag_bitsize ()
122#define HWASAN_TAG_GRANULE_SIZE targetm.memtag.granule_size ()
127#define HWASAN_STACK_BACKGROUND gen_int_mode (0, QImode)
139#define IFN_ASAN_MARK_FLAGS DEF(POISON), DEF(UNPOISON)
143#define DEF(X) ASAN_MARK_##X
164inline unsigned HOST_WIDE_INT
171 else if (size <= 128)
173 else if (size <= 512)
175 else if (size <= 4096)
202 return fcode == BUILT_IN_MEMCMP
203 || fcode == BUILT_IN_MEMCPY
204 || fcode == BUILT_IN_MEMMOVE
205 || fcode == BUILT_IN_MEMSET;
207 return fcode == BUILT_IN_INDEX
208 || fcode == BUILT_IN_MEMCHR
209 || fcode == BUILT_IN_MEMCMP
210 || fcode == BUILT_IN_MEMCPY
211 || fcode == BUILT_IN_MEMMOVE
212 || fcode == BUILT_IN_MEMSET
213 || fcode == BUILT_IN_STRCASECMP
214 || fcode == BUILT_IN_STRCAT
215 || fcode == BUILT_IN_STRCHR
216 || fcode == BUILT_IN_STRCMP
217 || fcode == BUILT_IN_STRCPY
218 || fcode == BUILT_IN_STRDUP
219 || fcode == BUILT_IN_STRLEN
220 || fcode == BUILT_IN_STRNCASECMP
221 || fcode == BUILT_IN_STRNCAT
222 || fcode == BUILT_IN_STRNCMP
223 || fcode == BUILT_IN_STRCSPN
224 || fcode == BUILT_IN_STRPBRK
225 || fcode == BUILT_IN_STRSPN
226 || fcode == BUILT_IN_STRSTR
227 || fcode == BUILT_IN_STRNCPY;
235 return (flag_sanitize_address_use_after_scope
257 if (result_flags == 0)
275 return (flag_sanitize_coverage
void asan_finish_file(void)
Definition asan.cc:3812
gimple_stmt_iterator create_cond_insert_point(gimple_stmt_iterator *iter, bool before_p, bool then_more_likely_p, bool create_then_fallthru_edge, basic_block *then_block, basic_block *fallthrough_block)
Definition asan.cc:2609
void hwasan_record_frame_init()
Definition asan.cc:4718
bool asan_protect_global(tree decl, bool ignore_decl_rtl_set_p)
Definition asan.cc:2427
void set_sanitized_sections(const char *sections)
Definition asan.cc:336
bool hwasan_expand_mark_ifn(gimple_stmt_iterator *)
Definition asan.cc:5052
hash_set< tree > * asan_used_labels
Definition asan.cc:258
bool hwasan_sanitize_stack_p()
Definition asan.cc:1871
bool gate_memtag()
Definition asan.cc:5064
void hwasan_record_stack_var(rtx untagged_base, rtx tagged_base, poly_int64 nearest_offset, poly_int64 farthest_offset)
Definition asan.cc:4639
bool asan_expand_check_ifn(gimple_stmt_iterator *iter, bool use_calls)
Definition asan.cc:4069
rtx hwasan_truncate_to_tag_size(rtx tag, rtx target)
Definition asan.cc:4913
rtx_insn * asan_emit_allocas_unpoison(rtx top, rtx bot, rtx_insn *before)
Definition asan.cc:2386
bool asan_expand_mark_ifn(gimple_stmt_iterator *iter)
Definition asan.cc:3955
bool asan_sanitize_allocas_p(void)
Definition asan.cc:368
bool memtag_sanitize_p()
Definition asan.cc:1940
bool hwasan_sanitize_p()
Definition asan.cc:1864
void hwasan_maybe_emit_frame_base_init()
Definition asan.cc:4616
void asan_maybe_insert_dynamic_shadow_at_function_entry(function *fun)
Definition asan.cc:511
bool memtag_sanitize_stack_p()
Definition asan.cc:1947
bool asan_expand_poison_ifn(gimple_stmt_iterator *iter, bool *need_commit_edge_insert, hash_map< tree, tree > &shadow_vars_mapping)
Definition asan.cc:4305
alias_set_type asan_shadow_set
Definition asan.cc:472
void hwasan_finish_file(void)
Definition asan.cc:4890
void hwasan_increment_frame_tag()
Definition asan.cc:4670
void asan_function_start(void)
Definition asan.cc:1557
bool stack_vars_base_reg_p(rtx base)
Definition asan.cc:4598
tree asan_dynamic_init_call(bool after_p)
Definition asan.cc:3343
bool memtag_sanitize_allocas_p(void)
Definition asan.cc:1954
bool gate_hwasan()
Definition asan.cc:5058
rtx asan_memfn_rtl(tree fndecl)
Definition asan.cc:396
bool asan_mark_p(gimple *stmt, enum asan_mark_flags flag)
Definition asan.cc:355
rtx_insn * hwasan_emit_untag_frame(rtx dynamic, rtx vars)
Definition asan.cc:4842
rtx hwasan_get_frame_extent()
Definition asan.cc:4659
rtx hwasan_frame_base()
Definition asan.cc:4577
bool asan_shadow_offset_set_p()
Definition asan.cc:467
bool asan_sanitize_stack_p(void)
Definition asan.cc:362
bool hwassist_sanitize_stack_p()
Definition asan.cc:1976
bool set_asan_shadow_offset(const char *val)
Definition asan.cc:315
void initialize_sanitizer_builtins(void)
Definition asan.cc:3591
rtx_insn * asan_emit_stack_protection(rtx base, rtx pbase, unsigned int alignb, HOST_WIDE_INT *offsets, tree *decls, int length)
Definition asan.cc:1995
bool hwasan_sanitize_allocas_p(void)
Definition asan.cc:1878
bool hwasan_expand_check_ifn(gimple_stmt_iterator *iter, bool)
Definition asan.cc:4966
uint8_t hwasan_current_frame_tag()
Definition asan.cc:4565
bool hwassist_sanitize_p()
Definition asan.cc:1969
hash_set< tree > * asan_handled_variables
Definition asan.cc:256
void hwasan_emit_prologue()
Definition asan.cc:4758
bool sanitize_flags_p(sanitize_code_type flag, const_tree fn=current_function_decl)
Definition asan.h:253
bool asan_intercepted_p(enum built_in_function fcode)
Definition asan.h:197
bool asan_protect_stack_decl(tree decl)
Definition asan.h:242
bool sanitize_coverage_p(const_tree fn=current_function_decl)
Definition asan.h:273
#define IFN_ASAN_MARK_FLAGS
Definition asan.h:139
bool asan_sanitize_use_after_scope(void)
Definition asan.h:233
#define ASAN_RED_ZONE_SIZE
Definition asan.h:85
asan_mark_flags
Definition asan.h:142
unsigned HOST_WIDE_INT asan_var_and_redzone_size(unsigned HOST_WIDE_INT size)
Definition asan.h:165
asan_check_flags
Definition asan.h:131
@ ASAN_CHECK_NON_ZERO_LEN
Definition asan.h:134
@ ASAN_CHECK_LAST
Definition asan.h:135
@ ASAN_CHECK_SCALAR_ACCESS
Definition asan.h:133
@ ASAN_CHECK_STORE
Definition asan.h:132
unsigned int asan_red_zone_size(unsigned int size)
Definition asan.h:155
tree lookup_attribute(const char *attr_name, tree list)
Definition attribs.h:223
struct basic_block_def * basic_block
Definition coretypes.h:351
struct rtx_def * rtx
Definition coretypes.h:57
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
int alias_set_type
Definition coretypes.h:345
uint64_t sanitize_code_type
Definition flag-types.h:359
built_in_function
Definition genmatch.cc:1018
poly_int< NUM_POLY_INT_COEFFS, HOST_WIDE_INT > poly_int64
Definition poly-int-types.h:24
Definition genautomata.cc:499
Definition function.h:249
Definition gimple-iterator.h:26
tree current_function_decl
Definition toplev.cc:129
unsigned HOST_WIDE_INT tree_to_uhwi(const_tree t)
Definition tree.cc:6716
#define TREE_VALUE(NODE)
Definition tree.h:1252
#define DECL_ATTRIBUTES(NODE)
Definition tree.h:2965
#define DECL_ARTIFICIAL(NODE)
Definition tree.h:3091
#define TREE_ADDRESSABLE(NODE)
Definition tree.h:757
#define NULL_TREE
Definition tree.h:318
#define DECL_P(NODE)
Definition tree.h:232