Closed Bug 1893651 Opened 1 year ago Closed 1 year ago

TypedArrayObject::getElements doesn't handle concurrent modifications when growing shared array buffer

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox125 --- disabled
firefox126 --- disabled
firefox127 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-race, reporter-external, sec-high)

Attachments

(1 file)

Run with while js --enable-arraybuffer-resizable /tmp/test.js; do true ; done.

Expected: No crash
Actual: *** stack smashing detected ***: terminated

Test case:

let maxByteLength = 500 * 1000;
let sab = new SharedArrayBuffer(0, {maxByteLength});

setSharedObject(sab);
evalInWorker(`
  let sab = getSharedObject();
  while (sab.byteLength < sab.maxByteLength) {
    sab.grow(Math.min(sab.byteLength + 13, sab.maxByteLength));
  }
  print("done worker");
`);

let ta = new Int8Array(sab);
while (ta.byteLength < maxByteLength) {
  Math.min.apply(null, ta);
}
print("done main");
Group: core-security → javascript-core-security
Severity: -- → S2
Priority: -- → P1

Resizable array buffers can only be enabled through a (defaulted to off) preference in Nightly builds, so Release, Beta, and ESR are all unaffected.

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a6ce02781fe2 Avoid repeated typed array length reads. r=jandem
Group: javascript-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
QA Whiteboard: [post-critsmash-triage]
Flags: qe-verify-
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: