Closed
Bug 1343752
Opened 7 years ago
Closed 7 years ago
Guard against modules list shrinking between EnumProcessModules calls
Categories
(Toolkit :: Telemetry, defect)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: away, Assigned: away)
References
Details
Attachments
(2 files, 2 obsolete files)
2.07 KB,
patch
|
marco
:
review+
|
Details | Diff | Splinter Review |
1.76 KB,
patch
|
cpearce
:
review+
|
Details | Diff | Splinter Review |
This seems very unlikely, but from my understanding of the docs, it's not guaranteed impossible.
Attachment #8842719 -
Flags: review?(mcastelluccio)
Assignee: nobody → dmajor
Attachment #8842723 -
Flags: review?(cpearce)
Comment 2•7 years ago
|
||
Isn't this going to cause a crash if the list grows between the calls?
Comment 3•7 years ago
|
||
To elaborate, if the list of modules were to grow, EnumProcessModules would fill up hMods safely, but set modulesSize to a value larger than before. The current code safely ignores that, but with the changes there might be an out-of-bounds access in the for loop.
What about resetting modulesNum only if the list shrinked?
> if (modulesSize / sizeof(HMODULE) < modulesNum) {
> modulesNum = modulesSize / sizeof(HMODULE);
> }
Attachment #8842719 -
Flags: review?(mcastelluccio)
Attachment #8842723 -
Flags: review?(cpearce)
Thanks for the catch.
Attachment #8842719 -
Attachment is obsolete: true
Attachment #8842723 -
Attachment is obsolete: true
Attachment #8843083 -
Flags: review?(mcastelluccio)
Attachment #8843123 -
Flags: review?(cpearce)
Updated•7 years ago
|
Attachment #8843123 -
Flags: review?(cpearce) → review+
Updated•7 years ago
|
Attachment #8843083 -
Flags: review?(mcastelluccio) → review+
Pushed by dmajor@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/4087fb7a5fb5 Guard against modules list shrinking between EnumProcessModules calls (media/) r=cpearce https://hg.mozilla.org/integration/mozilla-inbound/rev/7c3ed29c6ffb Guard against modules list shrinking between EnumProcessModules calls. (telemetry/) r=marco
Comment 8•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4087fb7a5fb5 https://hg.mozilla.org/mozilla-central/rev/7c3ed29c6ffb
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•