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](/bitcoin-bitcoin/11/) 0x7f11a5dd0b20 in std::terminate() (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x92b20)
[#12](/bitcoin-bitcoin/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.