Re: Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-20 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > @@ -7877,6 +7903,26 @@ gimple_build_vector (gimple_seq *seq, location_t loc, >return builder->build (); > } > > +/* Emit gimple statements into &stmts that take a value given in `old_size` > + and generate a value guaranteed to be rounded upwards to `align`. >

Re: Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Updates after latest review. (testing underway) --- There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in

Re: Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-19 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > +/* Emit gimple statements into &stmts that take the size given in `len` and > + generate a size that is guaranteed to be rounded upwards to `align`. > + > + This is a helper function for both handle_builtin_alloca and > + asan_expand_mark_ifn when using HWASAN. >

Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-19 Thread Matthew Malcomson via Gcc-patches
Update to match the change in initialisation for patch 5/X. MM --- There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in

[PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-16 Thread Matthew Malcomson via Gcc-patches
There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in the pointer being used match the tag stored in shadow memory for the m

Re: [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-10-14 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > @@ -133,6 +137,13 @@ enum asan_mark_flags > #undef DEF > }; > > +enum hwasan_mark_flags > +{ > +#define DEF(X) HWASAN_MARK_##X > + IFN_ASAN_MARK_FLAGS > +#undef DEF > +}; Are these used anywhere? It looks like expand_HWASAN_MARK uses the plain asan versions. > @

[PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-08-17 Thread Matthew Malcomson
There are four main features to this change: 1) Check pointer tags match address tags. In the new `hwasan` pass we put HWASAN_CHECK internal functions before all memory accesses to check that tags in the pointer being used match the tag stored in shadow memory for the memory region being used. T

Re: [PATCH 6/X] [libsanitizer] Add hwasan pass and associated gimple changes

2020-01-13 Thread Matthew Malcomson
> On 12/12/19 4:19 PM, Matthew Malcomson wrote: >> - if (is_store && !param_asan_instrument_writes) >> + if (is_store >> + && (!param_asan_instrument_writes || !param_hwasan_instrument_writes)) >> return; >> - if (!is_store && !param_asan_instrument_reads) >> + if (!is_store >> + && (!param_asan_in

Re: [PATCH 6/X] [libsanitizer] Add hwasan pass and associated gimple changes

2020-01-07 Thread Martin Liška
On 12/12/19 4:19 PM, Matthew Malcomson wrote: - if (is_store && !param_asan_instrument_writes) + if (is_store + && (!param_asan_instrument_writes || !param_hwasan_instrument_writes)) return; - if (!is_store && !param_asan_instrument_reads) + if (!is_store + && (!param_asan_instrument_reads || !pa

[PATCH 6/X] [libsanitizer] Add hwasan pass and associated gimple changes

2019-12-12 Thread Matthew Malcomson
There are four main features to this change: 1) Check pointer tags match address tags. In the new `hwasan` pass we put HWASAN_CHECK internal functions around all memory accesses, to check that tags in the pointer being used match the tag stored in shadow memory for the memory region being used.

Re: [PATCH 6/X] [libsanitizer] Add hwasan pass and associated gimple changes

2019-11-20 Thread Martin Liška
On 11/7/19 7:37 PM, Matthew Malcomson wrote: There are four main features to this change: 1) Check pointer tags match address tags. In the new `hwasan` pass we put HWASAN_CHECK internal functions around all memory accesses, to check that tags in the pointer being used match the tag stored in sh

[PATCH 6/X] [libsanitizer] Add hwasan pass and associated gimple changes

2019-11-07 Thread Matthew Malcomson
There are four main features to this change: 1) Check pointer tags match address tags. In the new `hwasan` pass we put HWASAN_CHECK internal functions around all memory accesses, to check that tags in the pointer being used match the tag stored in shadow memory for the memory region being used.