Closed Bug 1128490 Opened 10 years ago Closed 10 years ago

Crash [@ compartment] with use-after-free

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla38
Tracking Status
firefox36 --- unaffected
firefox37 --- unaffected
firefox38 + verified
firefox39 --- verified
firefox-esr31 --- unaffected
b2g-v1.4 --- unaffected
b2g-v2.0 --- unaffected
b2g-v2.0M --- unaffected
b2g-v2.1 --- unaffected
b2g-v2.1S --- unaffected
b2g-v2.2 --- unaffected
b2g-master --- fixed

People

(Reporter: decoder, Assigned: bhackett1024)

References

Details

(5 keywords, Whiteboard: [jsbugmon:update])

Crash Data

Attachments

(1 file)

The following testcase crashes on mozilla-central revision 940118b1adcd (build with --enable-optimize --enable-posix-nspr-emulation --enable-valgrind --enable-gczeal --enable-debug, run with --fuzzing-safe --thread-count=2 --ion-regalloc=backtracking): for (var i = 0; i < 1000; ++i) (function() { var isNotEmpty = function (obj) { for (var foo = 0 ; i < arguments.length; (function ( ) { } ) [ 0 ] ++) { var o = arguments[i]; } }; isNotEmpty([1]); })(); Backtrace: Program received signal SIGSEGV, Segmentation fault. compartment (this=0x7ffff57000e0) at js/src/jit/shared/MoveEmitter-x86-shared.cpp:510 510 } #0 compartment (this=0x7ffff57000e0) at js/src/jit/shared/MoveEmitter-x86-shared.cpp:510 #1 js::jit::AssertValidObjectPtr (cx=0x1a1cb70, obj=0x7ffff57000e0) at js/src/jit/VMFunctions.cpp:1177 #2 0x00007ffff55f2415 in ?? () #3 0x00007fffffffc560 in ?? () #4 0x00007fffffffc4f0 in ?? () #5 0xfffc7ffff57000e0 in ?? () #6 0x7ff8000000000000 in ?? () #7 0x3ff0000000000000 in ?? () #8 0x0000000000000000 in ?? () rax 0x2b2b2b2b2b2b2b2b 3110627432037296939 rbx 0x7ffff57000e0 140737311146208 rcx 0xfffbffffffffffff -1125899906842625 rdx 0x0 0 rsi 0x7ffff57000e0 140737311146208 rdi 0x1a1cb70 27380592 rbp 0x7fffffffc4d0 140737488340176 rsp 0x7fffffffc4b0 140737488340144 r8 0x7ff8000000000000 9221120237041090560 r9 0x7ffff5700000 140737311145984 r10 0x7fffffffc1c0 140737488339392 r11 0x7fffffffc380 140737488339840 r12 0x1a1cb70 27380592 r13 0x1a908d8 27855064 r14 0x7ffff575f100 140737311535360 r15 0x0 0 rip 0x978baa <js::jit::AssertValidObjectPtr(JSContext*, JSObject*)+42> => 0x978baa <js::jit::AssertValidObjectPtr(JSContext*, JSObject*)+42>: mov (%rax),%rax 0x978bad <js::jit::AssertValidObjectPtr(JSContext*, JSObject*)+45>: mov (%rdi),%rdi This is likely a use-after-free according to the crash pattern (GGC nursery poison pattern).
Whiteboard: [jsbugmon:update,bisect] → [jsbugmon:update]
JSBugMon: Bisection requested, result: autoBisect shows this is probably related to the following changeset: The first bad revision is: changeset: https://hg.mozilla.org/mozilla-central/rev/629c8aac3ece user: Brian Hackett date: Fri Jan 23 12:42:34 2015 -0700 summary: Bug 934502 - Remove unnecessary pushedArgumentSlots, track argument slots explicitly in safepoints, r=jandem. This iteration took 307.626 seconds to run.
Assignee: nobody → bhackett1024
Blocks: 934502
Keywords: sec-critical
Group: javascript-core-security
Flags: needinfo?(bhackett1024)
Attached patch patchSplinter Review
If a frame uses lazy arguments then its formals are not marked as aliased (like I thought) and but Ion uses special instructions to access the frame arguments directly. In this case marking the Ion frame needs to mark the formals as well as the actuals, and we need to be sure that the backtracking allocator doesn't spill other vregs to argument slots.
Flags: needinfo?(bhackett1024)
Attachment #8562186 - Flags: review?(jdemooij)
Attachment #8562186 - Flags: review?(jdemooij) → review+
Whoops, the script for a MIR graph can be null of course. https://hg.mozilla.org/integration/mozilla-inbound/rev/141b3ae089e9
Flags: needinfo?(bhackett1024)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Group: javascript-core-security
Group: core-security
Status: RESOLVED → VERIFIED
JSBugMon: This bug has been automatically verified fixed. JSBugMon: This bug has been automatically verified fixed on Fx38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: