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

Henrik/section #6500

Merged
merged 83 commits into from
Nov 18, 2022
Merged

Henrik/section #6500

merged 83 commits into from
Nov 18, 2022

Conversation

hbrodin
Copy link
Collaborator

@hbrodin hbrodin commented Nov 4, 2022

Updated section PR. Rewrite of the tdag output file handling to a more structured section-based approach.

@hbrodin hbrodin marked this pull request as draft November 4, 2022 12:45
@hbrodin hbrodin marked this pull request as ready for review November 7, 2022 15:30
@hbrodin hbrodin requested a review from surovic November 14, 2022 12:23
hbrodin and others added 26 commits November 15, 2022 13:19
Still very rough and with old/new code mixed. Highlights the main ideas of the section based approach.
Test cases for tdag c++ impl won't run due to build problems.
This section will be used as an index for which taint labels are source taint.
Future use might include the affects control flow marker.
First one is omitting the last source file byte from cavity range.
Second one is attempting to read the same file content multiple times,
resulting in printing empty strings.
Record the size of files used as taint sources when possible. Fallback handling in analysis
when not possible.
mypy.ini Show resolved Hide resolved
polytracker/include/taintdag/util.h Outdated Show resolved Hide resolved
@@ -73,49 +73,71 @@ def marker_to_ranges(self, m: bytearray) -> List[CavityType]:
ranges.append((start, i))
start = None
if start is not None:
ranges.append((start, len(m) - 1))
ranges.append((start, len(m)))
return ranges

def file_cavities(self) -> Dict[Path, List[CavityType]]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this tested for equivalent performance? We had issues with improperly implemented DFS traversals before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will look into the DFS performance. I don't think there should be much difference, but you never know. Good point!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@surovic I believe we can resolve this after our discussion, right?
The same DFS is used as previously. Also a bug was uncovered and is solved by this new implementation. We would incorrectly mark source offsets as used in case of multiple source files. Have probably not been a problem in practice though.

polytracker/src/taintdag/polytracker.cpp Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
unittests/src/taintdag/bitmap_section.cpp Outdated Show resolved Hide resolved
unittests/src/taintdag/error_exit_helper.h Outdated Show resolved Hide resolved
unittests/src/taintdag/tdag.cpp Outdated Show resolved Hide resolved
@surovic surovic self-requested a review November 15, 2022 17:30
polytracker/src/taintdag/polytracker.cpp Outdated Show resolved Hide resolved
polytracker/include/taintdag/section.h Outdated Show resolved Hide resolved
@surovic surovic merged commit bceac81 into master Nov 18, 2022
@surovic surovic deleted the Henrik/section branch November 18, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants