Skip to content

Conversation

practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Mar 28, 2021

Add fuzzing syscall sandbox: detect use of unexpected syscalls when fuzzing.

This PR is based on #20487. Only the last commit is new to this PR.

Example use:

$ make distclean
$ ./autogen.sh
$ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=fuzzer --with-syscall-sandbox
$ make
$ FUZZ=example_fuzzing_harness src/test/fuzz/fuzz
…
ERROR: The syscall "socket" (syscall number 41) is not allowed by the syscall sandbox in thread "*unnamed*". Please report. Exiting.
terminate called without an active exception
==27953== ERROR: libFuzzer: deadly signal
…
    #11 0x7f11a5dd0b20 in std::terminate() (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x92b20)
    #12 0x56445a4b8cb7 in (anonymous namespace)::SyscallSandboxDebugSignalHandler(int, siginfo_t*, void*) src/util/syscall_sandbox.cpp:71:5
…
artifact_prefix='./'; Test unit written to ./crash-78657a4e3dda0e9557c5a4f56dd9d19763459865

In this example use of an unexpected networking syscall (socket) was detected when running the example harness example_fuzzing_harness.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 28, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 3, 2021

🕵️ @jonatack @sipa have been requested to review this pull request as specified in the REVIEWERS file.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants