Closed Bug 1657812 Opened 4 years ago Closed 4 years ago

Crash [@ CoerceInPlace_JitEntry]

Categories

(Core :: JavaScript: WebAssembly, defect)

x86
All
defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox79 --- unaffected
firefox80 --- unaffected
firefox81 --- fixed

People

(Reporter: gkw, Assigned: dbezhetskov)

References

(Regression)

Details

(Keywords: regression, testcase)

Crash Data

Attachments

(1 file)

Attached file stack (deleted) —
var module = new WebAssembly.Module(wasmTextToBinary('\
  (memory 1) \
  (export "store" (func $func0)) \
  (func $func0 \
    (param $var0 i32) \
    (param $var1 i64) \
    local.get $var0 \
    local.get $var1 \
    i64.store16 offset=16 \
  ) \
'));
for (let i = 0; i < 10; i++) {
  try {
    for (let i = 0; i < 1; i++) {
      x = new WebAssembly.Instance(module);
    }
    for (let i = 0; i < 1; i++) {};
    x.exports["store"]();
  } catch (e) {}
}

Compiled using GCC 9.3.0 and Clang 9 with:

'CC="clang -m32 -msse2 -mfpmath=sse"' PKG_CONFIG_PATH=<path to your>/pkgconfig AR=ar 'CXX="clang++ -m32 -msse2 -mfpmath=sse"' sh ./configure --target=i686-pc-linux --enable-debug --with-ccache --enable-gczeal --enable-debug-symbols --disable-tests

Run with:

--fuzzing-safe --no-threads --no-baseline --no-ion

Tested on m-c rev d51942b1e2d8. This seems 32-bit only.

Will try to get a bisect soon. I did not set any Cranelift flags. Weird memory addresses are on the stack so setting s-s and sec-bounty? as a start.

:bbouvier seems afk (according to status), so setting needinfo? from :cfallin and :lth prior to the bisection result.

Flags: sec-bounty?
Flags: needinfo?(lhansen)
Flags: needinfo?
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) x/i $pc
=> 0x58f4e9b6 <CoerceInPlace_JitEntry(int, js::wasm::TlsData*, JS::Value*)+38>:	mov    0x8(%esi),%ecx
(gdb) x/b $esi
0xffffff8c:	Cannot access memory at address 0xffffff8c
(gdb) x/b $ecx
0xedc6a380:	0xf8
(gdb)

On Linux, does this mean in the $pc, we are trying to access memory address 0xffffff8c ?

Flags: needinfo?(cfallin)
Flags: needinfo?
The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/95d6c42f07fd
user:        Dmitry Bezhetskov
date:        Thu Aug 06 07:41:50 2020 +0000
summary:     Bug 1639153 - Part 1: Reserve two slots after stack arguments for the future tls preservation. r=lth

Dmitry, is bug 1639153 a likely regressor?

(Clearing needinfo? for :cfallin, this is not likely to involve Cranelift)

Flags: needinfo?(cfallin) → needinfo?(dbezhetskov)
Has Regression Range: --- → yes

(In reply to Gary Kwong [:gkw] [:nth10sd] (NOT official MoCo now) from comment #3)

The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/95d6c42f07fd
user:        Dmitry Bezhetskov
date:        Thu Aug 06 07:41:50 2020 +0000
summary:     Bug 1639153 - Part 1: Reserve two slots after stack arguments for the future tls preservation. r=lth

Dmitry, is bug 1639153 a likely regressor?

(Clearing needinfo? for :cfallin, this is not likely to involve Cranelift)

Yeah, that's my guess too, and I can try to verify, I've just had to finish up a different patch stack first...

Flags: needinfo?(lhansen)

This affects Windows 10 too, but is 32-bit only.

(In reply to Lars T Hansen [:lth] from comment #4)

Yeah, that's my guess too, and I can try to verify, I've just had to finish up a different patch stack first...

Thanks Lars!

OS: Linux → All
Hardware: All → x86

Backing out Dmitry's changes removes the crash.

The changes are being backed out from central, they caused a lot of problems.

Group: core-security → javascript-core-security
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Assignee: nobody → dbezhetskov
Group: javascript-core-security → core-security-release
Flags: needinfo?(dbezhetskov)
Target Milestone: --- → 81 Branch

Split bounty with bug 1657815 under the old rules, although clearly we would have fixed this one regardless based on the tons of other regressions not filed as security bugs. Under the new rules this bug would not have earned a bounty because all the collisions happened within the 4-day exclusion window from when the regressing bug landed.

Flags: sec-bounty? → sec-bounty+
Keywords: regression
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: