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

afl: Fix afl-qemu build by applying new patches #82432

Merged
merged 1 commit into from Mar 14, 2020

Conversation

Mindavi
Copy link
Contributor

@Mindavi Mindavi commented Mar 12, 2020

These patches are gathered from different sources,
such as https://patchwork.kernel.org/patch/10862231/ for the
gettid patch.
Another patch comes from the issue in the AFL repository.
The ultimate goal is to get these patches upstream as well,
so we don't keep these general patches only within nixos.

A PR is created against Google/AFL
google/AFL#79,
but it might take a while before it's landed, considering the history
of the project (there are more PRs open).

ZHF: #80379

Fixes issue #82232

Motivation for this change

Zero hydra failures, and I want to be able to use AFL without manually patching out the QEMU support from my local nixpkgs repository. I'm not using QEMU, but could imagine others wanting to use it.

Another solution might be dropping support for the qemu-mode, but I think keeping it is preferable.

Things done
  • Default on NixOS? Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Not sure how to do Determined the impact on package closure size (by running nix path-info -S before and after)
  • N/A Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@KamilaBorowska KamilaBorowska left a comment

Choose a reason for hiding this comment

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

Could we apply both syscall patches and have the glibc compilation fix patch only modify what needs to be changed for compilation to succeed? I don't think the part after @@ -11688,8 +11697,20 @@ abi_long do_syscall(void *cpu_env, int n is different.

These patches are gathered from different sources,
such as https://patchwork.kernel.org/patch/10862231/ for the
`gettid` patch.
Another patch comes from the issue in the AFL repository.
The ultimate goal is to get these patches upstream as well,
so we don't keep these general patches only within nixos.

A PR is created against Google/AFL
google/AFL#79,
but it might take a while before it's landed, considering the history
of the project (there are more PRs open).

ZHF: NixOS#80379

Fixes issue NixOS#82232
@Mindavi
Copy link
Contributor Author

Mindavi commented Mar 13, 2020

I like that better too, copying the original patch over is nonsense.

@alyssais alyssais merged commit 0874bd8 into NixOS:master Mar 14, 2020
@Mindavi Mindavi deleted the bugfix/afl-qemu-build branch November 21, 2021 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants