Closed Bug 1540166 Opened 7 years ago Closed 7 years ago

Don't run forgetSkippable during SnowWhiteFreeing

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox-esr60 67+ fixed
firefox66 --- wontfix
firefox67 + fixed
firefox68 + fixed

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

(Keywords: sec-high, Whiteboard: [adv-main67+][adv-esr60.7+])

Attachments

(1 file)

This is related to bug https://bugzilla.mozilla.org/show_bug.cgi?id=1318810
The theory is that event loop spins in some destructor. That isn't too good practice, but also we shouldn't try to run forgetSkippable.

When manually forcing forgetSkippable to happen during snowwhitefreeing, we're crashing at the same place as in https://bugzilla.mozilla.org/show_bug.cgi?id=1318810 on android.

Group: dom-core-security

Thanks for looking at this. I looked over the other places where we use the purple buffer, and the rest are either guarded like this, are deep inside the CC, or are inside Suspect methods, which I think the code intends to handle.

Comment on attachment 9054508 [details]
Bug 1540166, avoid some useless ForgetSkippable handling while we're already dealing with snow-white objects, r=mccr8

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: I don't know how to trigger the crash (expect manually injecting forgetSkippable calls). But the theory is that event loop spins at unexpected time.
  • 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, assuming the event loop spinning happens on all the branches
  • If not all supported branches, which bug introduced the flaw?: None
  • Do you have backports for the affected branches?: Yes
  • If not, how different, hard to create, and risky will they be?: The same patch seem to applies at least to esr60.
  • How likely is this patch to cause regressions; how much testing does it need?: Should be safe, since we just don't run CC optimization phase if event loop spins at odd time.
Attachment #9054508 - Flags: sec-approval?

this is to fix (some of?) the crashes in bug 1318810, and in those signatures I see a bunch of EXCEPTION_ACCESS_VIOLATION_EXEC crashes at exploitable-looking addresses like bp-31fce5d1-4f6c-41f6-8c27-856f60190329

We probably should be making 1318810 a security bug, but in the meantime calling this sec-high because at least these seem to be in the sandboxed content process.

Keywords: sec-high

Comment on attachment 9054508 [details]
Bug 1540166, avoid some useless ForgetSkippable handling while we're already dealing with snow-white objects, r=mccr8

sec-approval+ for trunk. Let's get a beta patch and ESR60 one nominated as well.

Attachment #9054508 - Flags: sec-approval? → sec-approval+

Comment on attachment 9054508 [details]
Bug 1540166, avoid some useless ForgetSkippable handling while we're already dealing with snow-white objects, r=mccr8

Beta/Release Uplift Approval Request

  • Feature/Bug causing the regression: NA
  • User impact if declined: See comment 3
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • 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):
  • String changes made/needed: NA

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration:
  • User impact if declined:
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky):
  • String or UUID changes made by this patch:
Attachment #9054508 - Flags: approval-mozilla-esr60?
Attachment #9054508 - Flags: approval-mozilla-beta?

Ah, no, this doesn't need QE.

Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

It is probably still too early to tell, but there have been no nsPurpleBufferEntry::Swap crashes since this landed in the Android Nightly. (20190330093331 is the last Android Nightly without this patch.)

Assignee: nobody → bugs

Still looking good.

... 20190330093331 is the last build with crashes.

Comment on attachment 9054508 [details]
Bug 1540166, avoid some useless ForgetSkippable handling while we're already dealing with snow-white objects, r=mccr8

Crashes stopped over the last week after landing on mozilla-central on the depending bugs, approved for 67 beta, thanks.

Attachment #9054508 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify-

Comment on attachment 9054508 [details]
Bug 1540166, avoid some useless ForgetSkippable handling while we're already dealing with snow-white objects, r=mccr8

Fix for sec-high crash, let's take it for 60.7 esr.

Attachment #9054508 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Whiteboard: [adv-main67+][adv-esr60.7+]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: