Re: [asan] Protection of stack vars (take 3)

2012-10-17 Thread Diego Novillo
On 2012-10-17 05:35 , Jakub Jelinek wrote: 2012-10-17 Jakub Jelinek * Makefile.in (asan.o): Depend on $(EXPR_H) $(OPTABS_H). (cfgexpand.o): Depend on asan.h. * asan.c: Include expr.h and optabs.h. (asan_shadow_set): New variable. (asan_shadow_cst, asan

Re: [asan] Protection of stack vars (take 3)

2012-10-17 Thread Xinliang David Li
Looks ok to me for the branch. thanks, David On Wed, Oct 17, 2012 at 2:35 AM, Jakub Jelinek wrote: > On Tue, Oct 16, 2012 at 03:56:31PM -0700, Xinliang David Li wrote: >> >> 1) I am not sure if the stack slot sharing is handled correctly. If I >> >> read the code correctly, the redzone var will

Re: [asan] Protection of stack vars (take 2)

2012-10-16 Thread Xinliang David Li
On Tue, Oct 16, 2012 at 2:52 PM, Jakub Jelinek wrote: > On Tue, Oct 16, 2012 at 01:56:46PM -0700, Xinliang David Li wrote: >> Looks good except for the following: >> >> 1) I am not sure if the stack slot sharing is handled correctly. If I >> read the code correctly, the redzone var will be only cr

Re: [asan] Protection of stack vars (take 2)

2012-10-16 Thread Jakub Jelinek
On Tue, Oct 16, 2012 at 01:56:46PM -0700, Xinliang David Li wrote: > Looks good except for the following: > > 1) I am not sure if the stack slot sharing is handled correctly. If I > read the code correctly, the redzone var will be only created for the > representative variable in a partition -- wi

Re: [asan] Protection of stack vars (take 2)

2012-10-16 Thread Xinliang David Li
Looks good except for the following: 1) I am not sure if the stack slot sharing is handled correctly. If I read the code correctly, the redzone var will be only created for the representative variable in a partition -- will this lead to false negatives? As I asked before, should stack slot sharing

Re: [asan] Protection of stack vars

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 11:10 AM, Jakub Jelinek wrote: > On Fri, Oct 12, 2012 at 10:52:04AM -0700, Xinliang David Li wrote: >> This is related to the way how you implement it. Emitting the stack >> shadow initialization code in GIMPLE would solve the problem. I think >> that would be cleaner. > >

Re: [asan] Protection of stack vars

2012-10-12 Thread Jakub Jelinek
On Fri, Oct 12, 2012 at 10:52:04AM -0700, Xinliang David Li wrote: > This is related to the way how you implement it. Emitting the stack > shadow initialization code in GIMPLE would solve the problem. I think > that would be cleaner. You'd need to duplicate all the stack slot sharing code, or adju

Re: [asan] Protection of stack vars

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 9:27 AM, Jakub Jelinek wrote: > Hi! > > This is not finished completely yet, but roughly implements protection > of stack variables. As testcase I was using: > extern void *malloc (__SIZE_TYPE__); > > int > main () > { > char buf1[16]; > char buf2[256]; > char buf3[3