Closed Bug 1651345 Opened 4 years ago Closed 4 years ago

GC issue in jsshell with `addMarkObservers`

Categories

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

78 Branch
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: cffsmith, Assigned: jonco)

Details

Attachments

(1 file)

This sample triggers a gc issue, accessing already free-poisoned memory, which seems to result from a call to the addMarkObservers builtin. This is triggered during fuzzing even with the --fuzzing-safe flag enabled.

function main() {
const v3 = {get:Object};
const v5 = Object.defineProperty(Object,0,v3);
addMarkObservers(Object, -1)
gc();
}
main();

It fails on the following assertion:

Assertion failure: flags() == 0, at /home/builder/firefox/js/src/gc/Cell.h:737

This is very likely no security issue as it requires access to the addMarkObservers builtin but I am filing this as a security issue just in case it can be triggered through a different method.

Jon, since this seems to be a GC issue I moving to the GC category, could you take a look at this?

Flags: needinfo?(jcoppeard)
Group: core-security → javascript-core-security
Component: JavaScript Engine → JavaScript: GC

This is shell-only problem in addMarkObservers.

Assignee: nobody → jcoppeard
Severity: -- → N/A
Flags: needinfo?(jcoppeard)
Priority: -- → P1

The problem is that it's not enough to evit the nursery once at the start of addMarkObservers since JS_GetElement can end up running a getter that creates new objects.

Group: javascript-core-security
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2cded7ee7fb2
Make addMarkObservers evict the nursery for every nursery-allocated argument it finds r=sfink
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: