Closed Bug 1666051 Opened 5 years ago Closed 5 years ago

Test cases (was: Crash at weird memory address on 32-bit builds)

Categories

(Core :: JavaScript Engine, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox81 --- unaffected
firefox82 --- fixed
firefox83 --- fixed

People

(Reporter: gkw, Assigned: lth)

References

(Blocks 1 open bug, Regression)

Details

(4 keywords, Whiteboard: [sec-survey][post-critsmash-triage])

Attachments

(2 files, 1 obsolete file)

Attached file debug stack

+++ This bug was initially created as a clone of Bug #1664953 +++

(function (stdlib) {
  "use asm";
  var sqrt = stdlib.Math.sqrt;
  function f(i0) {
    i0 = i0 | 0;
    i0 = ~~sqrt(-.5);
    return (1 / (1 >> (.0 == .0)) & i0 >> 1);
  }
  return f;
})(this)();

Opt shell:

(gdb) bt
#0  0x3d3bf004 in ?? ()
#1  0x7ff00000 in ?? ()
#2  0x3d3af114 in ?? ()
#3  0xf66f64c0 in ?? ()
(gdb) x/i $pc
=> 0x3d3bf004:	mov    0x10(%esi),%ecx
(gdb) x/b $esi
0x7ff00000:	Cannot access memory at address 0x7ff00000
(gdb) x/b $ecx
0xffffaad8:	0x00
(gdb)
The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/09390cf1d667
user:        Dmitry Bezhetskov
date:        Mon Sep 14 05:19:44 2020 +0000
summary:     Bug 1639153 - Part 6.6: Add tls dependency for truncate i32. r=lth

Run with --fuzzing-safe --no-threads --no-baseline --no-ion, compile with AR=ar sh ./configure --host=x86_64-pc-linux-gnu --target=i686-pc-linux --with-ccache --enable-gczeal --enable-debug-symbols --disable-tests, tested on m-c rev ab7d302fd318.

This seems specific to 32-bit builds.

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

Likely a dup of <redacted>, will check after the patch for that lands.

Flags: needinfo?(lhansen)
Assignee: nobody → dbezhetskov
Status: NEW → ASSIGNED

Actually this is the new bug, on x86 we assign WasmTlsReg as a return register for WasmBuiltinTruncateDToInt32 and clobber it in masm.branchTruncateDoubleMaybeModUint32 and then preserve/restore it on the ool path.

Flags: needinfo?(dbezhetskov)

Patch tentatively OK, needs commit message + try run. Will approve, but do not land anything without a green try run.

Severity: -- → S1
Priority: -- → P1

sec-high assuming "return register" is a jump location and not the return value.

Keywords: sec-high

I think this was fixed by a recent mega-backout, will retest.

I can repro on the named rev but not on current m-c, and I will assume the backout of bug 1639153 fixed this.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

Should we land the testcase from this bug?

Group: javascript-core-security → core-security-release
Flags: needinfo?(lhansen)
Target Milestone: --- → 83 Branch

(In reply to Ryan VanderMeulen [:RyanVM] from comment #8)

Should we land the testcase from this bug?

Yeah, we should. I'll prepare a patch.

Assignee: dbezhetskov → lhansen
Status: RESOLVED → REOPENED
Flags: needinfo?(lhansen)
Resolution: FIXED → ---

Landing test cases is not P1.

Severity: S1 → S3
Priority: P1 → P3
Summary: Crash at weird memory address on 32-bit builds → Test cases (was: Crash at weird memory address on 32-bit builds)

https://treeherder.mozilla.org/#/jobs?repo=try&revision=a351d72bdb50e007e342ec4ef1f7aed643f98ae9 (not security sensitive, as problems were backed out everywhere last week).

Attachment #9176817 - Attachment is obsolete: true

Test cases can just land, the offending code was backed out.

Flags: sec-bounty? → sec-bounty+
Regressed by: 1639153
No longer regressed by: 1664953
Has Regression Range: --- → yes

As part of a security bug pattern analysis, we are requesting your help with a high level analysis of this bug. It is our hope to develop static analysis (or potentially runtime/dynamic analysis) in the future to identify classes of bugs.

Please visit this google form to reply.

Flags: needinfo?(lhansen)
Whiteboard: [sec-survey]
Flags: needinfo?(lhansen)
Flags: qe-verify-
Whiteboard: [sec-survey] → [sec-survey][post-critsmash-triage]
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: