Skip to content

Conversation

@AdamL-Microsoft
Copy link
Owner

No description provided.

…2952)

Fixes #2941. 

It is possible for users to supply `target_options` which could interfere with the normal arguments that we pass. For example `-ignore_remaining_args=1` might be used when the user has custom options they need to parse in `LLVMFuzzerInitialize`.

To prevent these from interfering with our options, change the LibFuzzer code so that custom arguments are _always_ passed last.

This required two additional arguments to the `build_std_command` function:

- `extra_args` supplies any extra arguments needed by the system, for example, when testing the runnability of a fuzzer we pass `-help=1`. This is needed to be able to insert the argument before any custom args.
- `custom_arg_filter` can be supplied to perform any modifications on the custom arguments if needed. Since LibFuzzer arguments are last-one-wins, if we always pass custom args last, when we want to forcibly override the custom arguments we will need to remove them. Currently this is only used to remove any `-runs=X` arguments that are supplied when we are performing a single-input run.
@AdamL-Microsoft AdamL-Microsoft merged commit 0bd6de5 into AdamL-Microsoft:main Apr 3, 2023
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.

2 participants