-
Notifications
You must be signed in to change notification settings - Fork 37.7k
fuzz: Terminate immediately if a fuzzing harness tries to create a TCP socket (belt and suspenders) #21936
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
fuzz: Terminate immediately if a fuzzing harness tries to create a TCP socket (belt and suspenders) #21936
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
Concept ACK. Creating a TCP socket shouldn't happen accidentally :) Is this precautionary for future fuzzers added or something you stumbled on with current fuzzers? I'm interested in whether there needs to be many more of these kinds of footgun protections in case fuzzing goes down these uncontrolled paths. The alternative (I think) would be to say "If you run experimental fuzzers you are on your own". Protections such as the one introduced in this PR would just be there for the really dangerous paths. |
This is added purely as a cheap precautionary measure. The only "surprising" use of networking syscalls we've ever seen in the code base historically (AFAIK) is that the
The bullet proof approach to avoiding unexpected syscalls in Linux is to use seccomp-bpf. PR #20487 adds syscall sandbox support to Bitcoin Core using seccomp-bpf (opt-in at compile-time via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5454c9f
to
39394d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 39394d9
… a TCP socket (belt and suspenders)
39394d9
to
393992b
Compare
ACK 393992b |
… tries to create a TCP socket (belt and suspenders) 393992b fuzz: Terminate immediately if a fuzzing harness ever tries to create a TCP socket (belt and suspenders) (practicalswift) Pull request description: Terminate immediately if a fuzzing harness ever to create a TCP socket (belt and suspenders). Obviously this _should_ never happen, but if it _does_ happen we want immediate termination instead of a TCP socket :) ACKs for top commit: MarcoFalke: ACK 393992b Tree-SHA512: 5bbff1f7e9a58b3eae24f742b7daf3fc870424c985f29bed5931e47a708d9c0984bfd8762f43658cffa9c69d32f86d56deb48bc7e43821e3398052174b6a160e
Terminate immediately if a fuzzing harness ever to create a TCP socket (belt and suspenders).
Obviously this should never happen, but if it does happen we want immediate termination instead of a TCP socket :)