Closed Bug 1859116 Opened 1 year ago Closed 1 year ago

arm64: unhandled load-unscaled-signed-halfword (LDURSH) in js::wasm::SummarizeTrapInstruction

Categories

(Core :: JavaScript: WebAssembly, defect)

x86_64
Windows
defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox118 --- unaffected
firefox119 --- unaffected
firefox120 --- fixed

People

(Reporter: gkw, Assigned: jseward)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, reporter-external, testcase)

Attachments

(2 files)

Attached file debug stack
new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(`
  (module
    (func $fimport$0
      (param i32 i32)
    )
    (global $global$0
      (mut i32)
      (i32.const 0)
    )
    (memory 7)
    (func $0
      (result i64)
      (i64.const 1)
    )
    (func $2
      (param $0 i64)
      (if
        (global.get $global$0)
        (global.set $global$0
          (i32.const 1)
        )
      )
      (call $1
        (select
          (local.get 0)
          (call $0)
          (i32.load16_s
            (i32.const 1)
          )
        )
      )
    )
    (func $1
      (param $0 i64)
      (call $fimport$0
        (i32.wrap_i64
          (local.get 0)
        )
        (i32.wrap_i64
          (i64.const 0)
        )
      )
    )
  )
`)));
The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/656ad1cea330
user:        Julian Seward
date:        Mon Oct 02 17:07:03 2023 +0000
summary:     Bug 1846474 - Part 7: enable TrapSite debug checking for x86, x64, arm64.  r=rhunt.

Run with --fuzzing-safe --no-threads --no-baseline --no-ion, compile with sh ../configure --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 --enable-simulator=arm64 --enable-debug --enable-nspr-build --enable-ctypes --enable-debug-symbols --enable-gczeal --enable-rust-simd --disable-tests, tested on m-c rev c85ad51385ad.

Julian, is bug 1846474 a likely regressor? Setting s-s just-in-case for now.

Flags: sec-bounty?
Flags: needinfo?(jseward)

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

Group: core-security → javascript-core-security

Gary, thanks for finding this. What happened is, bug 1846474 added machinery
to perform some checks on the generated code after compilation has finished.
The assertion failed because the checker failed to identify one of the
instructions that the code generator created. The problem is with the
checker, not the code generator.

There is no error in the generated code or metadata, hence no security issue.

Assignee: nobody → jseward
Flags: needinfo?(jseward)
Summary: Assertion failure: valid (wasm trapsite does not reference a valid insn), at wasm/WasmGenerator.cpp:1109 → arm64: unhandled load-unscaled-signed-halfword (LDURSH) in js::wasm::SummarizeTrapInstruction

Unhiding as requested.

Group: javascript-core-security

On arm64, the instruction summarizer failed to handle
LDURSH Wt, [Xn|SP, #imm9] and LDURSH Xt, [Xn|SP, #imm9].
This patch fixes it.

tests/wasm/gc/signal-null-check.js is slightly extended to add suitable test
cases.

As a ridealong, in that test file, some assertDerefenceNulls are renamed to
assertDereferenceNull.

Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/18c9138dd733 arm64: unhandled load-unscaled-signed-halfword (LDURSH) in js::wasm::SummarizeTrapInstruction. r=yury
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Flags: sec-bounty? → sec-bounty-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: