Ensure access to mITimer is done under lock in nsTimerImpl
Categories
(Core :: XPCOM, defect)
Tracking
()
People
(Reporter: jesup, Assigned: jesup)
Details
(Keywords: csectype-uaf, sec-high, Whiteboard: [sec-survey][adv-main95+r][adv-ESR91.4.0+r])
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr91+
tjr
:
sec-approval+
|
Details | Review |
In nsTimerImpl::Fire(), we call callbackDuringFire.match() and pass a number of lambdas with references to mITimer... but we're not under the mutex.
See near the top of the function where we grab stuff under mutex, including kungFuDeathGrip on mITimer, which tells me that something else can null out mITimer once the lock is dropped.
Just using the kungFuDeathGrip should resolve this safely
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Comment on attachment 9249256 [details]
Bug 1739421: Use kungFuDeathGrip when firing a timer r=bwc
Security Approval Request
- How easily could an exploit be constructed based on the patch?: Pretty darn hard, perhaps not impossible
- Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
- Which older supported branches are affected by this flaw?: All
- If not all supported branches, which bug introduced the flaw?: None
- Do you have backports for the affected branches?: No
- If not, how different, hard to create, and risky will they be?: Trivial, no risk
- How likely is this patch to cause regressions; how much testing does it need?: No regressions likely
Comment 3•3 years ago
•
|
||
Comment on attachment 9249256 [details]
Bug 1739421: Use kungFuDeathGrip when firing a timer r=bwc
Approved to land and request uplift
Comment 4•3 years ago
|
||
Use kungFuDeathGrip when firing a timer r=bwc
https://hg.mozilla.org/integration/autoland/rev/786dcb2d210d3662928497544f3e2b1e51a0e771
https://hg.mozilla.org/mozilla-central/rev/786dcb2d210d
Comment 5•3 years ago
|
||
Can you suggest a security rating for this bug?
Assignee | ||
Comment 6•3 years ago
|
||
sec-high because of potential for UAF; no indication that this actually has occurred
Comment 7•3 years ago
|
||
The patch landed in nightly and beta is affected.
:jesup, is this bug important enough to require an uplift?
If not please set status_beta
to wontfix
.
For more information, please visit auto_nag documentation.
Comment 8•3 years ago
|
||
As part of a security bug pattern analysis, we are requesting your help with a high level analysis of this bug. It is our hope to develop static analysis (or potentially runtime/dynamic analysis) in the future to identify classes of bugs.
Please visit this google form to reply.
Assignee | ||
Comment 9•3 years ago
|
||
I don't think this needs an uplift, it's a proactive fix for something seen with static analysis
Assignee | ||
Comment 10•3 years ago
|
||
On second thought, while it should only be nullable (via Cancel), that unlocked write would be a potential TSAN violation, and this is a very, very safe patch, so let's uplift
Assignee | ||
Comment 11•3 years ago
|
||
Comment on attachment 9249256 [details]
Bug 1739421: Use kungFuDeathGrip when firing a timer r=bwc
Beta/Release Uplift Approval Request
- User impact if declined: Possible TSAN violation
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): We already held the timer in a kungfudeathgrip, so using that instead of mITimer is super-low-risk
- String changes made/needed: none
Comment 12•3 years ago
|
||
Comment on attachment 9249256 [details]
Bug 1739421: Use kungFuDeathGrip when firing a timer r=bwc
Approved for 95 beta 9, thanks.
Comment 13•3 years ago
|
||
uplift |
Comment 14•3 years ago
|
||
Comment on attachment 9249256 [details]
Bug 1739421: Use kungFuDeathGrip when firing a timer r=bwc
Also approved for 91.4esr.
Comment 15•3 years ago
|
||
uplift |
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•