Oliviers-OSS / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

implement adaptive redzones #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When instrumenting global arrays, we add fixed-size redzones (32 bytes) to them.
If the array has two or more dimensions, we're likely to miss the redzone even 
if the array index is off by one:

char arr[40][40];
char arr2[40];

arr[40][0] = 'a';  // this will hit arr2

We may want to vary the size for two-dimensional arrays depending on their 
sizes.

Original issue reported on code.google.com by ramosian.glider@gmail.com on 14 Oct 2011 at 6:51

GoogleCodeExporter commented 9 years ago

Original comment by ramosian.glider@gmail.com on 14 Oct 2011 at 6:51

GoogleCodeExporter commented 9 years ago
We may want to implement adaptive redzones for globals and for heap. 
Maybe even for stack. 
The hypothesis is that large objects tend to be overflown by larger amounts. 
I don't think this should have anything to do with two-dimensional arrays. 

Original comment by konstant...@gmail.com on 31 Oct 2011 at 5:44

GoogleCodeExporter commented 9 years ago

Original comment by ramosian.glider@gmail.com on 2 Feb 2012 at 12:14

GoogleCodeExporter commented 9 years ago
- adaptive redzones for globals are committed as LLVM r173335/r173336
- adaptive redzones for heap are a part of the new asan allocator

Need to think what to do with stack. 

Original comment by konstant...@gmail.com on 24 Jan 2013 at 10:38

GoogleCodeExporter commented 9 years ago

Original comment by ramosian.glider@gmail.com on 7 Feb 2013 at 4:02

GoogleCodeExporter commented 9 years ago
A somewhat related problem: http://llvm.org/bugs/show_bug.cgi?id=16277
(can't handle stack objects aligned by more than 32 bytes).
This may potentially be solved together with adaptive redzones for stack. 

Original comment by konstant...@gmail.com on 26 Jun 2013 at 9:56

GoogleCodeExporter commented 9 years ago
Fixed, see https://code.google.com/p/address-sanitizer/issues/detail?id=245#c2

Original comment by konstant...@gmail.com on 6 Dec 2013 at 9:12