-
Notifications
You must be signed in to change notification settings - Fork 85
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
libfuzzer does not work for some targets / programs #146
Comments
If, as suggested here, we skip |
Yeah, you cannot fuzz those targets (with a This is a good question regarding reachability of bugs. I cannot tell you off the top of my head, but you can probably look at papers that have previously evaluated with magma and compare the bugs reached/triggered across |
As far as we understand, you have already checked reachability for the MAGMA paper. From your paper:
|
Could you share the test cases that trigger the bugs with us? We can use them to check which harness triggers each bug, if you do not have that information already. |
POCs are here -> https://hexhive.epfl.ch/magma/docs/bugs.html |
Thanks, that helps. Is there a way to find the association between the bug ID used in the paper (e.g. |
I found out that 35eab0e changed the names and made a script to parse it: #!/usr/bin/env python3
import json
from pathlib import Path
import re
import subprocess
COMMIT_ID = "35eab0ee81000bf7167d780ddefffc51b3975d32"
MAGMA = Path(__file__).parent.parent
FORMATS = ["text", "json", "sed"]
# parse the output of git show <commit_id> and find the files that are renamed
def main(format: str = "text", reverse: bool = False):
if format not in FORMATS:
raise ValueError(f"invalid format: {format}")
p = subprocess.run(
["git", "show", COMMIT_ID], cwd=MAGMA, capture_output=True, check=True
)
renamed_bugs = {}
for line in p.stdout.decode().splitlines():
if m := re.match(r"^diff --git a/(.+) b/(.+)$", line):
file1, file2 = m.groups()
if file1 != file2 and file1.endswith(".patch"):
bug1 = Path(file1).stem
bug2 = Path(file2).stem
if format == "json":
if reverse:
renamed_bugs[bug2] = bug1
else:
renamed_bugs[bug1] = bug2
elif format == "sed":
if reverse:
print(f"s/{bug2}/{bug1}/g")
else:
print(f"s/{bug1}/{bug2}/g")
elif reverse:
print(bug2, ":", bug1)
else:
print(bug1, ":", bug2)
if format == "json":
print(json.dumps(renamed_bugs))
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description="Find renamed bugs in MAGMA")
parser.add_argument(
"-f",
"--format",
help="output format",
choices=FORMATS,
)
parser.add_argument(
"-r", "--reverse", help="reverse the renaming", action="store_true"
)
main(**vars(parser.parse_args())) |
That script is great! Thanks for that |
@EliaGeretto and I were trying to run libfuzzer but some programs (e.g.
xmllint
andlua
) are not instrumented correctly and call the original program'smain
instead of libfuzzer's. They seem like they are CLI programs and not drivers for fuzzers (i.e. using the libfuzzer interface).We were wondering if all bugs for a target can be triggered by all drivers for the same target; if not, do you know which bugs can be triggered by which driver?
The text was updated successfully, but these errors were encountered: