1. A Memory Error Detector for C/C++ by Google
l
Use
after free (dangling pointer dereference
)
l
Heap buffer overflow
l
Stack buffer overflow
l
Global buffer overflow
l
Use after return
l
Use after scope
l
Initialization order bugs
l
Memory
leaks
2.
Red-zone : A memory area inserted between memory regions for checking accessing validity.
Shadow Memory : Every aligned 8-byte word of memory has only 9 stats.
There are only 9 different values for any aligned 8 bytes of the application memory:
l
All
8 bytes in qword are
unpoisoned
(i.e. addressable). The shadow value is 0
.
l
All
8 bytes in qword are poisoned (i.e. not addressable). The shadow value is negative
.
l
First
k bytes are
unpoisoned
, the rest 8-k are poisoned. The shadow value is k. This is guaranteed by the fact that
malloc
returns 8-byte aligned chunks of memory. The only case where different bytes of an aligned qword have different state is the tail of a
malloc-ed
region. For example, if we call
malloc
(13), we will have one full
unpoisoned
qword and one qword where 5 first bytes are
unpoisoned
.
l
Shadow memory address = (Normal memory address >> 3) + 0x100000000
-Instrumentation module : Insert code for checking state at the location occurred me