-
Notifications
You must be signed in to change notification settings - Fork 528
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
Bug 5383: handleNegotiationResult() level-2 debugs() crash #1856
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2288,8 +2288,8 @@ clientNegotiateSSL(int fd, void *data) | |
return; | ||
|
||
case Security::IoResult::ioError: | ||
debugs(83, (handshakeResult.important ? Important(62) : 2), "ERROR: " << handshakeResult.errorDescription << | ||
" while accepting a TLS connection on " << conn->clientConnection << ": " << handshakeResult.errorDetail); | ||
debugs(83, (handshakeResult.important ? Important(62) : 2), "ERROR: Cannot accept a TLS connection" << | ||
Debug::Extra << "problem: " << WithExtras(handshakeResult)); | ||
// TODO: No ConnStateData::tunnelOnError() on this forward-proxy code | ||
// path because we cannot know the intended connection target? | ||
conn->updateError(ERR_SECURE_ACCEPT_FAIL, handshakeResult.errorDetail); | ||
|
@@ -3036,8 +3036,8 @@ ConnStateData::handleSslBumpHandshakeError(const Security::IoResult &handshakeRe | |
} | ||
|
||
case Security::IoResult::ioError: | ||
debugs(83, (handshakeResult.important ? DBG_IMPORTANT : 2), "ERROR: " << handshakeResult.errorDescription << | ||
" while SslBump-accepting a TLS connection on " << clientConnection << ": " << handshakeResult.errorDetail); | ||
debugs(83, (handshakeResult.important ? DBG_IMPORTANT : 2), "ERROR: Cannot SslBump-accept a TLS connection" << | ||
Debug::Extra << "problem: " << WithExtras(handshakeResult)); | ||
updateError(errCategory = ERR_SECURE_ACCEPT_FAIL, handshakeResult.errorDetail); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. - ERROR: failure while SslBump-accepting a TLS connection on conn35 local=127.0.0.1:3130 remote=127.0.0.1:53250 FD 20 flags=1: SQUID_TLS_ERR_ACCEPT+TLS_LIB_ERR=A00018A+TLS_IO_ERR=1
- current master transaction: master53
+ ERROR: Cannot SslBump-accept a TLS connection
+ problem: failure
+ error detail: SQUID_TLS_ERR_ACCEPT+TLS_LIB_ERR=A00018A+TLS_IO_ERR=1
+ current master transaction: master54 No client-to-Squid connection reporting here because we do have a master transaction in this context. Admins are supposed to correlate that with their access.log entries if they need more information. We are using the same transaction/context-based approach for other level-0/1 messages as well. |
||
break; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,9 +278,9 @@ Security::PeerConnector::handleNegotiationResult(const Security::IoResult &resul | |
} | ||
|
||
// TODO: Honor result.important when working in a reverse proxy role? | ||
debugs(83, 2, "ERROR: Cannot establish a TLS connection to " << serverConnection() << ':' << | ||
Debug::Extra << "problem: " << result.errorDescription << | ||
yadij marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RawPointer("detail: ", result.errorDetail).asExtra()); | ||
debugs(83, 2, "ERROR: Cannot establish a TLS connection" << | ||
Debug::Extra << "problem: " << WithExtras(result) << | ||
Debug::Extra << "connection: " << serverConnection()); | ||
recordNegotiationDetails(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above debugs() is where the reported bug was triggered, but all three debugs() have similar dangerous/buggy code. - 83,2| PeerConnector.cc(281) handleNegotiationResult: ERROR: Cannot establish a TLS connection to conn38 local=127.0.0.1:35992 remote=127.0.0.1:443 HIER_DIRECT FD 22 flags=1:
- problem: failure
- detail: SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=A000410+TLS_IO_ERR=1
+ 83,2| PeerConnector.cc(281) handleNegotiationResult: ERROR: Cannot establish a TLS connection
+ problem: failure
+ error detail: SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=A000410+TLS_IO_ERR=1
+ connection: conn38 local=127.0.0.1:58424 remote=127.0.0.1:443 HIER_DIRECT FD 22 flags=1 We do want to report Squid-to-peer connection in such contexts because, unlike the client-to-Squid connection discussed elsewhere in this review, there may be multiple Squid-to-peer connections per master transaction and our access.log records do not record their details. Please note that this is a level-2 message in current code. There is a corresponding TODO to upgrade "important" messages to level-1, and the message is already formatted as a level-0/1 message, so I used WithExtras() here. |
||
noteNegotiationError(result.errorDetail); | ||
} | ||
|
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.
Client-to-Squid connection is still reported here (via CodeContext) even though it is not visible in new code. That is likely to (automatically) change as we start allocating or preserving master transaction context earlier, but current PR reporting is OK.