-
Notifications
You must be signed in to change notification settings - Fork 36.6k
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
net: Add regression fuzz harness for CVE-2017-18350. Add FuzzedSocket. #19203
Conversation
Concept ACK |
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. |
2a31e08
to
3c83df2
Compare
3c83df2
to
44157f4
Compare
44157f4
to
2a4d581
Compare
2a4d581
to
f28d7be
Compare
f28d7be
to
4b17a6b
Compare
9002ce9
to
ff13f09
Compare
Code review ACK ff13f09 |
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.
left some style feedback
ad65949
to
88af030
Compare
@laanwj Thanks for the quick review! ❤️ Pushed an updated version addressing @MarcoFalke's feedback. Should hopefully be ready for final review. |
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 88af030
Running the new fuzz test for a few tens of minutes produces no errors. Reverting the fix for CVE-2017–18350 like this: --- i/src/netbase.cpp
+++ w/src/netbase.cpp
@@ -533,13 +533,13 @@ bool Socks5(const std::string& strDest, int port, const ProxyCredentials* auth,
case SOCKS5Atyp::DOMAINNAME:
{
recvr = InterruptibleRecv(pchRet3, 1, SOCKS5_RECV_TIMEOUT, sock);
if (recvr != IntrRecvError::OK) {
return error("Error reading from proxy");
}
- int nRecv = pchRet3[0];
+ int nRecv = (char)pchRet3[0];
recvr = InterruptibleRecv(pchRet3, nRecv, SOCKS5_RECV_TIMEOUT, sock);
break;
}
default: return error("Error: malformed proxy response");
}
if (recvr != IntrRecvError::OK) { crashes the test in less than a minute. |
The PR description needs an update since it mentions 4 commits, but there are just 2 now. |
Ah yes I had already updated the PR title for it, but you're right that the description is out of date too. |
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.
Code review ACK 88af030 with caveat that I don't know very much about fuzzing so ignore my suggestions.
d06d25c
to
b62b90f
Compare
b62b90f looks good except that the first commit does not compile:
(the second commit fixes this) |
b62b90f
to
366e3e1
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 366e3e1
Add regression fuzz harness for CVE-2017-18350. This fuzzing harness would have found CVE-2017-18350 within a minute of fuzzing :)
See
doc/fuzzing.md
for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the Bitcoin Core fuzzing corpus repo.Happy fuzzing :)