Skip to content
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

src: remove unused sync result from ASYNC_CALL #3049

Closed
wants to merge 1 commit into from

Conversation

skomski
Copy link
Contributor

@skomski skomski commented Sep 24, 2015

Fixes use-after-free of req_wrap if uv returns early err

@mscdex mscdex added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Sep 24, 2015
@bnoordhuis
Copy link
Member

I'm 95% sure some APMs use the return value.

@skomski skomski force-pushed the fix-ufe-req-wrap branch 2 times, most recently from babbc51 to e3dc2f6 Compare September 26, 2015 20:38
@skomski
Copy link
Contributor Author

skomski commented Sep 26, 2015

Updated to only fix the use-after-free without removing the unused sync result because APMs maybe use it.

@@ -273,8 +273,9 @@ struct fs_req_wrap {
uv_req->result = err; \
uv_req->path = nullptr; \
After(uv_req); \
Copy link
Member

Choose a reason for hiding this comment

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

Can you set req_wrap = nullptr here?

Aside: the uv_req->path = nullptr is a memory leak waiting to happen. It's mostly benign now - I think.

@skomski
Copy link
Contributor Author

skomski commented Oct 7, 2015

Merge?

@bnoordhuis
Copy link
Member

@skomski
Copy link
Contributor Author

skomski commented Oct 8, 2015

CI looks fine except of course stringbytes-external.

bnoordhuis pushed a commit to bnoordhuis/io.js that referenced this pull request Oct 8, 2015
PR-URL: nodejs#3049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@bnoordhuis
Copy link
Member

Thanks Karl, landed in ccaaae9.

@bnoordhuis bnoordhuis closed this Oct 8, 2015
@jasnell
Copy link
Member

jasnell commented Oct 9, 2015

@bnoordhuis ... should this land in v4.x before 4.2.0 lts is cut?

@bnoordhuis
Copy link
Member

It won't hurt. I've added the tag.

jasnell pushed a commit that referenced this pull request Oct 9, 2015
PR-URL: #3049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins
Copy link
Contributor

landed in v4.x-staging as 2314378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants