Skip to content

[Backport][0.8 to 0.7] | Fix fd leak in accept() when setsockopt fails (#1248) (#1330) (#1376) - #1405

Merged
lihuiba merged 1 commit into
release/0.7from
backport-pr-876611bc652437518bc9f09c2b54b8eabebd4c54-0.7
Jun 17, 2026
Merged

[Backport][0.8 to 0.7] | Fix fd leak in accept() when setsockopt fails (#1248) (#1330) (#1376) #1405
lihuiba merged 1 commit into
release/0.7from
backport-pr-876611bc652437518bc9f09c2b54b8eabebd4c54-0.7

Conversation

@photonlibos

Copy link
Copy Markdown
Collaborator

Fix fd leak in accept() when setsockopt fails (#1248) (#1330) (#1376)

When KernelSocketServer::accept() successfully accepts a connection
but setsockopt() subsequently fails, the accepted fd was leaked.
Added ::close(cfd) on the error path.

Co-authored-by: Jiangtian Feng jiangtianf97@163.com
Co-authored-by: Claude Opus 4.6 noreply@anthropic.com
Generated by Backport Auto PR, by cherry-pick related commits.

Please review and decide whether to merge or close this backport PR.

When KernelSocketServer::accept() successfully accepts a connection
but setsockopt() subsequently fails, the accepted fd was leaked.
Added ::close(cfd) on the error path.

Co-authored-by: Jiangtian Feng <jiangtianf97@163.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@lihuiba
lihuiba merged commit 736aae5 into release/0.7 Jun 17, 2026
12 of 14 checks passed
@photonlibos
photonlibos deleted the backport-pr-876611bc652437518bc9f09c2b54b8eabebd4c54-0.7 branch June 17, 2026 02:10
lihuiba pushed a commit that referenced this pull request Jun 17, 2026
…#1405) (#1453)

When KernelSocketServer::accept() successfully accepts a connection
but setsockopt() subsequently fails, the accepted fd was leaked.
Added ::close(cfd) on the error path.

Co-authored-by: Jiangtian Feng <jiangtianf97@163.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants