Remove length check on debug log content - #131521
Open
rcj1 wants to merge 1 commit into
Open
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates CoreCLR’s debugger right-side (DBI) handling for DB_IPCE_FIRST_LOG_MESSAGE by relaxing validation around the logged message content length, while keeping (and tightening) validation for the log switch/category name.
Changes:
- Remove the
0x10000max-length validation for log message content inCordbProcess::RawDispatchEvent. - Switch the log switch/category length validation to use
MAX_LOG_SWITCH_NAME_LEN.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/debug/di/process.cpp | Adjusts validation for debugger log-message event handling (category bounded by MAX_LOG_SWITCH_NAME_LEN, content no longer capped by 0x10000). |
Copilot's findings
Comments suppressed due to low confidence (1)
src/coreclr/debug/di/process.cpp:4933
- With the cchContent upper-bound check removed, this block can now overflow when computing cbExpected = cchContent * sizeof(WCHAR), and it also treats a short/partial ReadVirtual as success (cbRead is ignored), which can leave uninitialized data in the buffers passed to the callback. This file already has SafeReadBuffer() which enforces cbRead == expected size and returns ERROR_PARTIAL_COPY.
Recommend adding an overflow guard for the byte-size computation and switching these reads to SafeReadBuffer (or otherwise validating cbRead).
if (cchCategory > MAX_LOG_SWITCH_NAME_LEN)
{
IfFailThrow(E_UNEXPECTED);
}
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #131073