-
Notifications
You must be signed in to change notification settings - Fork 216
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
Fix a possible UAF #669
Fix a possible UAF #669
Conversation
Thanks for reporting this and submitting a fix! I have a couple of questions:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #669 +/- ##
==========================================
+ Coverage 77.56% 77.76% +0.19%
==========================================
Files 197 197
Lines 27638 27654 +16
Branches 5486 5487 +1
==========================================
+ Hits 21438 21505 +67
- Misses 4326 4327 +1
+ Partials 1874 1822 -52 ☔ View full report in Codecov by Sentry. |
Thanks for your reply.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question, thanks for the PR!
@@ -100,6 +100,12 @@ int UvList(struct uv *uv, | |||
|
|||
if (rv != 0 && *segments != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to the PR strictly but what does rv != 0
mean here @cole-miller. It is set in the above loop and it is overwritten every iteration so rv
here is the return code of the last entry that we process, right? We are ignoring the return codes of all the entries but this one, is that sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key is lines 64-72, if we get one nonzero return code from You're right, I wasn't reading closely enough, those lines don't work as intended because of UvSnapshotInfoAppendIfMatch
or uvSegmentInfoAppendIfMatch
then we skip processing the rest of the files in the list.uv_fs_scandir_next
just above.
Got a UAF on an old version of Dqlite. This should fix it.