Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-10 Thread Jakub Jelinek via Gcc-patches
On Wed, Jun 10, 2020 at 01:14:59PM +0200, Martin Liška wrote: > >From 4d2e0b1e87b08ec21fd82144f00d364687030706 Mon Sep 17 00:00:00 2001 > From: Martin Liska > Date: Tue, 19 May 2020 16:57:56 +0200 > Subject: [PATCH] Add missing store in emission of asan_stack_free. > > gcc

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-10 Thread Martin Liška
4d2e0b1e87b08ec21fd82144f00d364687030706 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 19 May 2020 16:57:56 +0200 Subject: [PATCH] Add missing store in emission of asan_stack_free. gcc/ChangeLog: 2020-05-19 Martin Liska PR sanitizer/94910 * asan.c (asan_emit_stack_protection)

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-10 Thread Jakub Jelinek via Gcc-patches
On Wed, Jun 10, 2020 at 11:49:01AM +0200, Martin Liška wrote: > - store_by_pieces (shadow_mem, sz, builtin_memset_read_str, &c, > - BITS_PER_UNIT, true, RETURN_BEGIN); > + { > + /* Emit: > +memset(ShadowBase, kAsanStackAfterReturnMagic, ShadowSize); >

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-10 Thread Martin Liška
t the updated patch? I must confess that RTL instruction emission is not my strength. Martin >From 16e46a532c059930887bc30f82c3054a75a5a56d Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 19 May 2020 16:57:56 +0200 Subject: [PATCH] Add missing store in emission of asan_stack_free. gcc/ChangeLo

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-10 Thread Jakub Jelinek via Gcc-patches
On Wed, Jun 10, 2020 at 10:24:59AM +0200, Martin Liška wrote: > > > This doesn't look correct to me. > > > I'd think the first adjust_address should be > > >   mem = adjust_address (mem, ptr_mode, offset); > > > which will give you a MEM with ptr_mode which has SavedFlagPtr(FakeStack) > > > add

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-10 Thread Martin Liška
On 6/1/20 3:18 PM, Martin Liška wrote: On 6/1/20 2:52 PM, Jakub Jelinek wrote: On Mon, Jun 01, 2020 at 02:28:51PM +0200, Martin Liška wrote: --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1598,8 +1598,24 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb,     if (use_after_retu

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-01 Thread Martin Liška
On 6/1/20 2:52 PM, Jakub Jelinek wrote: On Mon, Jun 01, 2020 at 02:28:51PM +0200, Martin Liška wrote: --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1598,8 +1598,24 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb, if (use_after_return_class < 5 && can_store_by_p

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-01 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 01, 2020 at 02:28:51PM +0200, Martin Liška wrote: > --- a/gcc/asan.c > +++ b/gcc/asan.c > @@ -1598,8 +1598,24 @@ asan_emit_stack_protection (rtx base, rtx pbase, > unsigned int alignb, >if (use_after_return_class < 5 > && can_store_by_pieces (sz, builtin_memset_read_str

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-06-01 Thread Martin Liška
cc0c3378cca3de1 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 19 May 2020 16:57:56 +0200 Subject: [PATCH] Add missing store in emission of asan_stack_free. gcc/ChangeLog: 2020-05-19 Martin Liska PR sanitizer/94910 * asan.c (asan_emit_stack_protection): Emit also **SavedFlagPtr(F

Re: [PATCH] Add missing store in emission of asan_stack_free.

2020-05-20 Thread Franz Sirl
Am 2020-05-19 um 21:05 schrieb Martin Liška: Hi. We make direct emission for asan_emit_stack_protection for smaller stacks. That's fine but we're missing the piece that marks the stack as released and we run out of pre-allocated stacks. I also included some stack-related constants that were used

[PATCH] Add missing store in emission of asan_stack_free.

2020-05-19 Thread Martin Liška
Hi. We make direct emission for asan_emit_stack_protection for smaller stacks. That's fine but we're missing the piece that marks the stack as released and we run out of pre-allocated stacks. I also included some stack-related constants that were used in asan.c. Patch can bootstrap on x86_64-lin