Closed Bug 1904649 Opened 1 year ago Closed 1 year ago

Assertion failure: false, at js/src/vm/SelfHosting.cpp:436

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- disabled
firefox127 --- disabled
firefox128 --- disabled
firefox129 --- fixed

People

(Reporter: sm-bugs, Assigned: anba)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: regression, reporter-external)

Attachments

(3 files)

Attached file bug.js

Steps to reproduce:

Checkout commit 9fcc11127fbfbdc88cbf37489dac90542e141c77 and invoke the js shell as follows:

js --fuzzing-safe <test-case>


Actual results:

Assertion failure: false, at js/src/vm/SelfHosting.cpp:436

Blocks: 1903968
Group: firefox-core-security → core-security
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Version: Firefox 127 → Trunk
Group: core-security → javascript-core-security
Self-hosted JavaScript assertion info: ./../js/src/builtin/TypedArray.js:810: unexpected missing element

Reduced test below. Glancing at the code, these lines in resizableTypedArrayElementShiftBy look suspicious because both branchPtr calls have the same condition.

var buf = new SharedArrayBuffer(51, {maxByteLength:51});
new Float16Array(buf).lastIndexOf();
Flags: needinfo?(dminor)
Keywords: regression
Regressed by: 1833647
Status: UNCONFIRMED → NEW
Ever confirmed: true

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

Taking because it blocks bug 1835034, for which I've started some initial patches.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Flags: needinfo?(dminor)
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/44c41a7dfb0b Part 1: Jump not branch for float16. r=jandem https://hg.mozilla.org/integration/autoland/rev/4247c85f7948 Part 2: Add Float16Array to existing tests. r=jandem
Blocks: sm-security
Severity: -- → S3
Priority: -- → P1

What are the security implications of this problem? Security issues that affect more than Nightly need sec-approval before landing, if they are worse than sec-moderate. This bug does not even have a rating yet. Thanks.

Flags: needinfo?(andrebargull)
Duplicate of this bug: 1904862

Float16Array isn't available outside of Nightly, see also bug 1903329, which removed the Nightly-only restriction and enabled Float16Array by default.

Flags: needinfo?(andrebargull)

This still needs a security rating, if only for possible bug bounty consideration, so if somebody could say what the security implications are it would be appreciated.

I don't see any obvious sec-issues with this bug:

  • This issue only affects length-tracking Float16Array with a growable SharedArrayBuffer.
  • When tracking the length, the byte length of the underlying growable SharedArrayBuffer is read and then divided by the TypedArray's BYTES_PER_ELEMENT.
  • Before the patch, the SharedArrayBuffer's byte length was divided by 8, but the correct divisor should have been 2.
  • That means a too small length value was reported.

The overall affected operations are:

  • The in operator. This led to reporting that an element is absent even though it's actually present. (The in operator with an indexed operand is compiled as index < typedArray.length.)
  • The TypedArray.prototype.length and TypedArray.prototype.byteLength accessor properties. This led to reporting a too small length resp. byte-length value.
  • The self-hosting intrinsic functions TypedArrayLength and PossiblyWrappedTypedArrayLength. This is probably the most interesting case, but after checking all callers to these two functions, I didn't see any obvious issue when reporting a too small length value.
Group: javascript-core-security
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch

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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: