-
Notifications
You must be signed in to change notification settings - Fork 42k
Fix possible fd leak and closing of dirs in doSafeMakeDir #79534
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
Conversation
This fixes the issue where "childFD" from syscall.Openat is assigned to a local variable inside the for loop, instead of the correct one in the function scope. This results in that when trying to close the "childFD" in the function scope, it will be equal to "-1", instead of the correct value.
|
Hi @odinuge. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/sig storage /cc @BenTheElder |
|
/assign |
|
Nice catch! |
|
/priority important-longterm |
|
/lgtm Thanks for finding and fixing this! |
|
/assign @saad-ali |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msau42, odinuge The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I think it would be good to backport it |
…4-upstream-release-1.14 Automated cherry pick of #79534: Fix closing of dirs in doSafeMakeDir
…4-upstream-release-1.13 Automated cherry pick of #79534: Fix closing of dirs in doSafeMakeDir
…4-upstream-release-1.15 Automated cherry pick of #79534: Fix closing of dirs in doSafeMakeDir
What type of PR is this?
/kind bug
What this PR does / why we need it:
This fixes the issue where "childFD" from syscall.Openat is assigned to
a local variable inside the for loop, instead of the correct one in the
function scope. This results in that when trying to close the "childFD"
in the function scope, it will be equal to "-1", instead of the correct
value.
No huge chance of an fd leak, but better safe than sorry 🤷♂
doSafeOpenis very similar, but has correct handling of this.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: