Skip to content

syncd: Fix file descriptor leak in MdioIpcServer#1830

Open
theycallmeaabie wants to merge 1 commit intosonic-net:masterfrom
theycallmeaabie:fix/mdio-ipc-server-fd-leak
Open

syncd: Fix file descriptor leak in MdioIpcServer#1830
theycallmeaabie wants to merge 1 commit intosonic-net:masterfrom
theycallmeaabie:fix/mdio-ipc-server-fd-leak

Conversation

@theycallmeaabie
Copy link
Copy Markdown

Description

Fixes #1829
The directory file descriptor opened via open(path, O_DIRECTORY) in MdioIpcServer::syncd_ipc_task_main() was never closed on any code path early error returns or normal exit.

Changes

  • Close fd immediately after the directory existence check succeeds, since it is not used beyond that point

Impact

Prevents file descriptor exhaustion on repeated IPC task restarts due to socket failures.

Signed-off-by: theycallmeaabie <theycallmeaabie@gmail.com>
Copilot AI review requested due to automatic review settings April 4, 2026 02:18
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 4, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: theycallmeaabie / name: theycallmeaabie (e1226dc)

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a file descriptor leak in syncd’s MDIO IPC server loop by ensuring the directory FD opened to validate the IPC socket directory is properly closed, preventing FD exhaustion during repeated task restarts.

Changes:

  • Close the directory file descriptor (fd) immediately after the directory existence check succeeds in MdioIpcServer::syncd_ipc_task_main().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] File descriptor leak in MdioIpcServer::syncd_ipc_task_main

3 participants