Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve heap tracking #36

Open
wants to merge 21 commits into
base: improve-analysis-with-sources-and-gdb
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
701e472
pt: Add logging macros
aewag Mar 2, 2023
36007a1
pt/proc-map: Add ProcMap commands
aewag Mar 3, 2023
65c4522
pt/addrtrace: Add type & vec for imgobj
aewag Mar 3, 2023
65f1300
pt/addrtrace: Trace stack and vvar region
aewag Mar 3, 2023
dd28a8a
pt/addrtrace: Activate CallStackManager
aewag Mar 3, 2023
1563971
pt/addrtrace: Add print- & get- fns for CallStack
aewag Mar 3, 2023
1b4c89d
pt/addrtrace: Restructure instrumentMainAndAlloc fn
aewag Mar 3, 2023
fde079a
pt/addrtrace: Add image and sections to imgvec
aewag Mar 3, 2023
d72f4d0
pt/addrtrace: Add heap tracing with logical addrs
aewag Mar 3, 2023
917c255
analysis/analyze: Delete apply of masks for heap
aewag Mar 23, 2022
347b4df
pt/addrtrace: Rm unused masks for heap operations
aewag Mar 4, 2023
f033d4c
pt/addrtrace: Add option to stop tracing within memory allocations
aewag Mar 3, 2023
312762d
pt/addrtrace: Add syscall alloc id macros
aewag Mar 2, 2023
27cca57
pt/addrtrace: Add Syscall Entry & Exit tracing
aewag Mar 3, 2023
6106255
pt/addrtrace: Add [m, mre]map to thread_state
aewag Mar 4, 2023
224395a
pt/addrtrace: Add handlers for [m,mre,mun]map & brk
aewag Mar 4, 2023
3ea855a
pt/addrtrace: Call [m,mre,mun]map & brk within syscall handler
aewag Mar 4, 2023
1c45883
pt/addrtrace: Exit if no log_addr, except phase 1
aewag Mar 6, 2023
2975634
pt/utils: Print Heap and Allocmap at exit
aewag Mar 6, 2023
e934450
pt/call-stack: Log demangled function name
aewag Feb 14, 2023
858ee06
pt/addrtrace: Reuse logical addrs for heap tracing
aewag Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions analysis/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
SPLeak,
TraceQueue,
Type,
MaskType,
Leak,
)
import multiprocessing
Expand Down Expand Up @@ -320,9 +319,6 @@ def iterate_queue(files, fast=True):
assert e1.data != 0
assert e2.data != 0
assert queues[0].callstack == queues[1].callstack
if Type(e1.type) in (Type.HREAD, Type.HWRITE):
e1.data &= 0x00000000FFFFFFFF
e2.data &= 0x00000000FFFFFFFF
if e1.data != e2.data:
report_dataleak(queues[0].callstack, e1, e2)
else:
Expand All @@ -333,11 +329,6 @@ def iterate_queue(files, fast=True):
# Mixture of heap and non-heap read/write. Maybe, heap tracking is imprecise
# We require that both elements are either (h)read or (h)write
debug(0, "Imprecise heap tracking @ %08x", (e1.ip))
# assert((e1.type | MaskType.HEAP.value) == (e2.type | MaskType.HEAP.value))
if (e1.type | MaskType.HEAP.value) > 0:
e1.data &= 0x00000000FFFFFFFF
if (e2.type | MaskType.HEAP.value) > 0:
e2.data &= 0x00000000FFFFFFFF
report_dataleak(queues[0].callstack, e1, e2)
else:
# This should never happen. We miss some conditional branches in the code
Expand Down
Loading