Skip to content

Handle truncation errors in diagnostic IPC transport names - #132220

Merged
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:ipc-transport-fix
Aug 13, 2026
Merged

Handle truncation errors in diagnostic IPC transport names#132220
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:ipc-transport-fix

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

Port the EventPipe diagnostic IPC transport fix from dotnet/dotnet#8241 (commit 90e1097e9e4ad09e4aa3da19bf7dd73ee0eaaa2a) to main.

PAL_GetTransportName reports failure by leaving the output empty. Propagate that failure and reject truncated or empty Unix-domain socket paths instead of allowing an empty sun_path to bind in the Linux abstract namespace.

Testing

  • build.cmd clr.runtime -rc checked
  • build.cmd clr.corelib+clr.nativecorelib+libs.pretest -rc checked -lc release
  • src\tests\build.cmd -Test tracing/eventpipe/diagnosticport/diagnosticport.csproj x64 Checked
  • diagnosticport.cmd with DOTNET_TieredCompilation=0

Note

This pull request description was generated with GitHub Copilot.

Propagate failures when generating diagnostic IPC socket names and reject truncated or empty Unix-domain socket paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 572c5f77-8001-4916-b5d1-502c66b60415
@azure-pipelines

Copy link
Copy Markdown
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.

@max-charlamb
max-charlamb requested a review from steveisok August 12, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens EventPipe diagnostics IPC socket name generation on Unix by treating name-generation failures (including truncation) as fatal, preventing an empty sockaddr_un.sun_path from accidentally binding in the Linux abstract namespace.

Changes:

  • Propagate PAL_GetTransportName failure by checking for name[0] != '\0' (rather than assuming success).
  • Reject truncated or empty Unix-domain socket paths during UDS address allocation, and add error-path cleanup to avoid leaks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/native/eventpipe/ds-ipc-pal-socket.c Validates UDS socket path generation/copying, rejects truncation/empty paths, and adds structured cleanup on error.
src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h Makes ds_rt_transport_get_default_name report failure when PAL_GetTransportName leaves the output empty.

@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g unrelated test failures

@max-charlamb
max-charlamb merged commit 2ae298c into dotnet:main Aug 13, 2026
125 of 129 checks passed
@max-charlamb
max-charlamb deleted the ipc-transport-fix branch August 13, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants