Closed Bug 1884237 Opened 2 years ago Closed 2 years ago

[WASM] Assertion failure: !producer->isDiscarded() in CheckOperand

Categories

(Core :: JavaScript: WebAssembly, defect)

Firefox 125
defect

Tracking

()

RESOLVED DUPLICATE of bug 1883944

People

(Reporter: cz18811105578, Unassigned)

Details

(Keywords: reporter-external)

Attachments

(1 file)

7.21 KB, text/javascript
Details
Attached file poc0308.js —

Steps to reproduce:

HG : e04e6de576337b55bd3e4b0f7afaa408bc782aa3
Build :
ac_add_options --enable-project=js
ac_add_options --disable-optimize
ac_add_options --disable-unified-build
ac_add_options --enable-debug
ac_add_options --disable-jemalloc
ac_add_options --disable-jemalloc

Running the POC with --wasm-compiler=ion

Actual results:

  * frame #0: 0x59d417ba js`CheckOperand(consumer=<unavailable>, use=<unavailable>, usesBalance=0xffff9ee4) at IonAnalysis.cpp:3296:3
    frame #1: 0x59d3fcd9 js`js::jit::AssertBasicGraphCoherency(graph=0xffffa1c0, force=<unavailable>) at IonAnalysis.cpp:3440:9
    frame #2: 0x59cc7613 js`js::jit::OptimizeMIR(mir=0xffffa100) at Ion.cpp:989:3
    frame #3: 0x5a6645f7 js`js::wasm::IonCompileFunctions(moduleEnv=0xffffc130, compilerEnv=0xffffb738, lifo=0x5b886258, inputs=0x5b88628c, code=0x5b8864c0, error=0xffffc32c) at WasmIonCompile.cpp:9358:12
    frame #4: 0x5a5ff0ec js`ExecuteCompileTask(task=<unavailable>, error=<unavailable>) at WasmGenerator.cpp:729:12
    frame #5: 0x5a6012c2 js`js::wasm::ModuleGenerator::finishFuncDefs() [inlined] js::wasm::ModuleGenerator::locallyCompileCurrentTask(this=0xffffb764) at WasmGenerator.cpp:784:8
    frame #6: 0x5a6012ba js`js::wasm::ModuleGenerator::finishFuncDefs(this=0xffffb764) at WasmGenerator.cpp:915:24
    frame #7: 0x5a5cf33d js`bool DecodeCodeSection<js::wasm::Decoder>(env=0xffffc130, d=0xffffb748, mg=0xffffb764) at WasmCompile.cpp:785:13
    frame #8: 0x5a5cec8b js`js::wasm::CompileBuffer(args=0x5b8776c0, bytecode=0x5b852f40, error=0xffffc32c, warnings=0xffffc348, listener=0x00000000) at WasmCompile.cpp:807:8
    frame #9: 0x5a702998 js`js::WasmModuleObject::construct(cx=0x5b757470, argc=1, vp=0x5b8757e8) at WasmJS.cpp:1494:7
    frame #10: 0x58353c4d js`CallJSNative(cx=0x5b757470, native=(js`js::WasmModuleObject::construct(JSContext*, unsigned int, JS::Value*) at WasmJS.cpp:1449), reason=Call, args=0xffffcb24)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) at Interpreter.cpp:480:13
    frame #11: 0x583b92df js`CallJSNativeConstructor(cx=0x5b757470, native=(js`js::WasmModuleObject::construct(JSContext*, unsigned int, JS::Value*) at WasmJS.cpp:1449), args=0xffffcb24)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) at Interpreter.cpp:496:8
    frame #12: 0x58356509 js`InternalConstruct(cx=0x5b757470, args=0xffffcb24, reason=Call) at Interpreter.cpp:702:14
    frame #13: 0x5837a718 js`js::Interpret(JSContext*, js::RunState&) [inlined] js::ConstructFromStack(cx=0x5b757470, args=0xffffcb24, reason=<unavailable>) at Interpreter.cpp:749:10
    frame #14: 0x5837a70b js`js::Interpret(cx=0x5b757470, state=0xffffcc40) at Interpreter.cpp:3046:16
    frame #15: 0x58351965 js`MaybeEnterInterpreterTrampoline(cx=0x5b757470, state=<unavailable>) at Interpreter.cpp:394:10
    frame #16: 0x58351671 js`js::RunScript(cx=0x5b757470, state=0xffffcc40) at Interpreter.cpp:452:13
    frame #17: 0x58357d93 js`js::ExecuteKernel(cx=0x5b757470, script=JS::HandleScript @ 0xffffcc84, envChainArg=JS::HandleObject @ 0xffffcc88, evalInFrame=(ptr_ = 0), result=JS::MutableHandleValue @ 0xffffcc90) at Interpreter.cpp:839:13
    frame #18: 0x58358866 js`js::Execute(cx=0x5b757470, script=JS::HandleScript @ 0xffffccd4, envChain=JS::HandleObject @ 0xffffccd8, rval=JS::MutableHandleValue @ 0xffffccdc) at Interpreter.cpp:871:10
    frame #19: 0x5893227f js`ExecuteScript(cx=0x5b757470, envChain=JS::HandleObject @ 0xffffcd10, script=JS::HandleScript @ 0xffffcd14, rval=<unavailable>) at CompilationAndEvaluation.cpp:494:10
    frame #20: 0x589324fe js`JS_ExecuteScript(cx=0x5b757470, scriptArg=JS::HandleScript @ 0xffffcd64) at CompilationAndEvaluation.cpp:518:10
    frame #21: 0x5826ef04 js`RunFile(cx=<unavailable>, filename=<unavailable>, file=0x5b851bc0, compileMethod=DontInflate, compileOnly=<unavailable>, fullParse=<unavailable>) at js.cpp:1200:10
    frame #22: 0x5826d223 js`Process(cx=<unavailable>, filename="/tmp/poc.js", forceTTY=<unavailable>, kind=FileScript) at js.cpp:1780:14
    frame #23: 0x581d4da2 js`Shell(JSContext*, js::cli::OptionParser*) at js.cpp:10991:10
    frame #24: 0x581d4cc8 js`Shell(cx=0x5b757470, op=0xffffd1c8) at js.cpp:11250:12
    frame #25: 0x581c799a js`main(argc=2, argv=0xffffd314) at js.cpp:11758:12
    frame #26: 0xf7a8ced5 libc.so.6`__libc_start_main + 245
    frame #27: 0x58189a61 js`_start + 49
    frame #28: 0x58189a61 js`_start + 49
Group: core-security → javascript-core-security

Reduced test case:

new WebAssembly.Module(wasmTextToBinary(`(module
  (func $f0 (param i32 ) 
    try_table (catch_all 0 )
      loop 
        i32.const 0
        call $f0
        i32.const 1
        br_if 0
      end
    end
    br 0 
  )
)`));

Most likely duplicate of bug 1882772 or bug 1883944

This is a duplicate of bug 1883944.

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1883944
Resolution: --- → DUPLICATE
Flags: sec-bounty?
Flags: sec-bounty? → sec-bounty-
Group: javascript-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: