Closed Bug 2036691 Opened 6 months ago Closed 6 months ago

Investigate issues with addWeakRefObservers/addRecordObservers and transplant JS shell coverage

Categories

(Core :: JavaScript: GC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox150 --- unaffected
firefox151 --- wontfix
firefox152 --- fixed

People

(Reporter: jandem, Assigned: jonco)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, sec-audit, Whiteboard: [adv-main152-])

Attachments

(2 external files)

Audits found two related issues:

  1. In addWeakRefObservers and addRecordObservers we can iloop in non-debug builds because the loops call list.getFirst() instead of list.popFirst().
  2. transplantableObject() in the shell always uses JS_CloneObject to create a fresh target. So the merge path — where the transplant target already has WeakRef/FR observers — is structurally unreachable from the shell.

We should figure out which transplant cases exist in the browser that currently can't be tested in the JS shell. We should then try to make those testable so that we can write shell tests for (1).

I looked a bit into our JS shell coverage of the transplant cases and most of the code can be exercised in the shell.

It's possible the merge paths in (1) are dead but I'm not completely sure.

Keywords: sec-audit
Assignee: nobody → jcoppeard
Component: JavaScript Engine → JavaScript: GC

This code was added in bug 2032512.

Type: task → defect
Keywords: regression
Regressed by: 2032512

Set release status flags based on info from the regressing bug 2032512

Attached file (secure) —

Rather than having a separate fast path when there are no previous observers,
add an append method to ObserverList and call it in all cases. I check that our
existing tests hit this.

Blocks: sm-security
Severity: -- → S3
Priority: -- → P1
Attached file (secure) —

This adds some basic tests for the ObserverList data structure. This is a
linked list of weakly held ObserverListObjects with the links held in object
slots.

Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/11a3fb3fc3b0 https://hg.mozilla.org/integration/autoland/rev/c9ffa9902eab Revert "Bug 2036691 - Add tests for ObserverList r=spidermonkey-reviewers,iain" for causing hazard failures @testObserverList.cpp.

Backed out for causing hazard failures @testObserverList.cpp

Flags: needinfo?(jcoppeard)
Flags: needinfo?(jcoppeard)
Group: javascript-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 6 months ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [sec] [qa-triage-done-c153/b152]
Whiteboard: [adv-main152-]
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: