Skip to content

Add Mutator Plugins as a Strategy#286

Merged
jonathanmetzman merged 34 commits into
masterfrom
plugin3
Mar 27, 2019
Merged

Add Mutator Plugins as a Strategy#286
jonathanmetzman merged 34 commits into
masterfrom
plugin3

Conversation

@jonathanmetzman

Copy link
Copy Markdown
Collaborator

No description provided.

@googlebot googlebot added the cla: yes CLA signed. label Mar 20, 2019
@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@mhlakhani

Copy link
Copy Markdown

Will we add usage documentation for this after we've verified the feature works well? Really excited to see this idea land and be usable.

@jonathanmetzman

jonathanmetzman commented Mar 20, 2019

Copy link
Copy Markdown
Collaborator Author

Will we add usage documentation for this after we've verified the feature works well? Really excited to see this idea land and be usable.

Sure. I plan on first seeing if this feature is useful. If it is and we decide to make the feature permanent, I'll add documentation and make it "supported" for other users.

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

Comment thread configs/test/project.yaml
"""Test running libFuzzer fuzzer."""
libfuzzer = fuzzer.LibFuzzer()

# Don't test mutator_plugins here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I test it elsewhere so it isn't needed here. But when the test ran before it would spend a really long time and then error out when talking to GCS. Maybe we should get this working?

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

Sorry for the spam folks, my local tests weren't quite working so I was using the upload/gcbrun workflow a bit too aggressively.

@oliverchang

Copy link
Copy Markdown
Collaborator

for OSS-Fuzz, you'll need to add a line here: https://github.com/google/clusterfuzz/blob/master/src/appengine/handlers/cron/oss_fuzz_setup.py#L745

to give workers permissions to access the relevant buckets.

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

cc @kcc @afd @paulthomson

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

@oliverchang oliverchang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice! some suggestions about the implementation

Comment thread src/python/bot/fuzzers/libFuzzer/fuzzer.py Outdated
Comment thread src/python/bot/fuzzers/builtin.py Outdated
Comment thread src/python/bot/fuzzers/libfuzzer.py Outdated
Comment thread src/python/bot/fuzzers/mutator_plugin.py Outdated
Comment thread src/python/bot/fuzzers/mutator_plugin.py Outdated
Comment thread src/python/bot/fuzzers/mutator_plugin.py Outdated
Comment thread src/python/bot/fuzzers/mutator_plugin.py Outdated
Comment thread configs/test/project.yaml
Comment thread src/python/bot/fuzzers/libFuzzer/launcher.py Outdated
Comment thread src/python/bot/fuzzers/libFuzzer/launcher.py Outdated
Comment thread src/python/bot/fuzzers/libFuzzer/launcher.py Outdated
Comment thread src/python/bot/fuzzers/libFuzzer/launcher.py
Comment thread src/python/bot/fuzzers/mutator_plugin.py
Comment thread src/python/bot/fuzzers/mutator_plugin.py Outdated
Comment thread src/python/tests/core/bot/fuzzers/mutator_plugin_test.py
Comment thread src/python/bot/fuzzers/mutator_plugin.py
Comment thread src/python/bot/fuzzers/mutator_plugin.py Outdated
@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@inferno-chromium

Copy link
Copy Markdown
Collaborator

This CL is getting huge, best to split into 2-3 parts for faster review and easier understanding.

  1. just plugin mutator strategy, buckets
  2. mutator strategy
  3. minijail support
  4. whatver, bug fixes, etc.

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@inferno-chromium inferno-chromium left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great. Some questions and minor nits.

Comment thread src/python/bot/fuzzers/libFuzzer/launcher.py Outdated
Comment thread src/python/bot/fuzzers/libfuzzer.py Outdated
"""Creates directories needed to use mutator plugins."""

def recreate_directory(directory_path):
shell.create_directory_if_needed(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks very hacky, to do create_directory_if_needed first and then remove_directory. Why do we need to remove and re-download plugin everytime ? Is this for every launcher instance ? We need to make sure we dont even unpack if it was unpacked once.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This looks very hacky, to do create_directory_if_needed first and then remove_directory. Why do we need to remove and re-download plugin everytime ?

What if the plugin gets updated?

Is this for every launcher instance ?

Yes.

We need to make sure we dont even unpack if it was unpacked once.

I intentionally do this. I agree it would be less wasteful to unpack once for every 5 runs of launcher.py. I believe the code did this initially, but it was suggested that I change this so that mutator plugins would more easily work on OSS-Fuzz.

Comment thread src/python/bot/fuzzers/mutator_plugin.py
@jonathanmetzman

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@jonathanmetzman
jonathanmetzman merged commit 27d0dcb into master Mar 27, 2019
@jonathanmetzman
jonathanmetzman deleted the plugin3 branch March 27, 2019 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes CLA signed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants