Closed Bug 1969375 Opened 5 months ago Closed 4 months ago

ResolveResponse_fulfilled doesn't handle OOMs correctly

Categories

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

All
Linux
defect

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox-esr140 --- wontfix
firefox139 --- wontfix
firefox140 --- wontfix
firefox141 --- wontfix
firefox142 --- fixed

People

(Reporter: gkw, Assigned: rhunt)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: regression, reporter-external, testcase)

Attachments

(2 files)

Attached file debug stack
function f() {
  drainJobQueue();
  WebAssembly.compileStreaming();
  oomTest(f);
}
f();
(gdb) bt
#0  0x000055555732e2d9 in MOZ_CrashSequence (aAddress=0x0, aLine=402)
    at /home/ubuomni14/shell-cache/js-dbg-64-linux-x86_64-3f2fd0c018c9/objdir-js/dist/include/mozilla/Assertions.h:248
#1  AssertExceptionResult (cx=cx@entry=0x7ffff653a200) at /home/ubuomni14/trees/mozilla-central/js/src/vm/Interpreter.cpp:401
#2  0x000055555735260f in CallJSNative (cx=cx@entry=0x7ffff653a200, native=<optimized out>, reason=<optimized out>, args=...)
    at /home/ubuomni14/trees/mozilla-central/js/src/vm/Interpreter.cpp:499
#3  0x000055555732e5b6 in js::InternalCallOrConstruct (cx=0x7ffff653a200, args=..., construct=construct@entry=js::NO_CONSTRUCT,
    reason=js::CallReason::Call) at /home/ubuomni14/trees/mozilla-central/js/src/vm/Interpreter.cpp:590
#4  0x000055555732f318 in InternalCall (cx=<optimized out>, args=..., reason=402, reason@entry=js::CallReason::Call)
    at /home/ubuomni14/trees/mozilla-central/js/src/vm/Interpreter.cpp:657
#5  0x000055555732f533 in js::Call (cx=cx@entry=0x7ffff653a200, fval=fval@entry=..., thisv=thisv@entry=..., args=..., rval=rval@entry=...,
    reason=reason@entry=js::CallReason::Call) at /home/ubuomni14/trees/mozilla-central/js/src/vm/Interpreter.cpp:689
/snip
The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/68e60c65b23f
user:        Ryan Hunt
date:        Mon Mar 24 18:05:38 2025 +0000
summary:     Bug 1931407 - wasm: Rework bytecode handling for compilation to avoid copies. r=yury

Run with --fuzzing-safe --ion-offthread-compile=off --ion-eager, compile with AR=ar sh ../configure --enable-debug --enable-debug-symbols --with-ccache --enable-nspr-build --enable-ctypes --enable-gczeal --enable-rust-simd --disable-tests, tested on m-c rev 3f2fd0c018c9.

Ryan, is bug 1931407 a likely regressor?

Note that possible regressor bug 1931407 had some comments about looking through its regressors for possible uplifting, so this bug might need one as well.

Flags: sec-bounty?
Flags: needinfo?(rhunt)
Group: core-security → javascript-core-security

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

Assignee: nobody → rhunt
Flags: needinfo?(rhunt)
Severity: -- → S3
Priority: -- → P1

This is just an OOM handling issue where we fail to report the OOM error. Not security sensitive.

Group: javascript-core-security
Summary: Assertion failure: cx->isExceptionPending() || cx->isPropagatingForcedReturn() || cx->hadUncatchableException(), at vm/Interpreter.cpp:402 → ResolveResponse_fulfilled doesn't handle OOMs correctly
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch

The patch landed in nightly and beta is affected.
:rhunt, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(rhunt)

I don't think so. It's a very rare small OOM condition that will result in a crash if it happens.

Flags: needinfo?(rhunt)
Flags: sec-bounty? → sec-bounty-
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: