Closed
Bug 787283
Opened 12 years ago
Closed 12 years ago
Assertion failure: i >= 0, at jsopcode.cpp:5820 or Crash [@ js::DecompileValueGenerator]
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: decoder, Assigned: jandem)
References
Details
(5 keywords, Whiteboard: [js:t] [jsbugmon:][adv-main21+][adv-esr1706+] fixed by bug 810525)
Attachments
(1 file)
(deleted),
patch
|
bhackett1024
:
review+
lsblakk
:
approval-mozilla-esr17+
lsblakk
:
approval-mozilla-b2g18+
|
Details | Diff | Splinter Review |
The following testcase asserts on mozilla-central revision 1b0b56afa33a (run with -m -n -a):
Object.prototype.apply = Function.prototype.apply;
function testApplyCallHelper(f) {
var i = 0;
i.apply(this,[,,2])
}
testApplyCallHelper()
Reporter | ||
Comment 1•12 years ago
|
||
Opt-build shows:
==52813== Invalid read of size 8
==52813== at 0x4BA2E0: js::DecompileValueGenerator(JSContext*, int, JS::Handle<JS::Value>, JS::Handle<JSString*>, int) (jsopcode.cpp:5823)
==52813== by 0x437C08: js_ReportValueErrorFlags(JSContext*, unsigned int, unsigned int, int, JS::Handle<JS::Value>, JS::Handle<JSString*>, char const*, char const*) (jscntxt.cpp:958)
==52813== by 0x490E80: js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) (jsinterp.cpp:242)
==52813== by 0x634D7B: js::mjit::stubs::SlowCall(js::VMFrame&, unsigned int) (InvokeHelpers.cpp:133)
==52813== by 0x621DB7: js::mjit::ic::NativeCall(js::VMFrame&, js::mjit::ic::CallICInfo*) (MonoIC.cpp:1008)
==52813== by 0x403AAA6: ???
==52813== by 0x5B64B6: js::mjit::EnterMethodJIT(JSContext*, js::StackFrame*, void*, JS::Value*, bool) (MethodJIT.cpp:1016)
==52813== by 0x5B665D: js::mjit::JaegerShot(JSContext*, bool) (MethodJIT.cpp:1074)
==52813== by 0x48F555: js::Interpret(JSContext*, js::StackFrame*, js::InterpMode) (jsinterp.cpp:2438)
==52813== by 0x5B64F3: js::mjit::EnterMethodJIT(JSContext*, js::StackFrame*, void*, JS::Value*, bool) (MethodJIT.cpp:1043)
==52813== by 0x5B665D: js::mjit::JaegerShot(JSContext*, bool) (MethodJIT.cpp:1074)
==52813== by 0x490C76: js::RunScript(JSContext*, JSScript*, js::StackFrame*) (jsinterp.cpp:298)
==52813== Address 0x6091618 is 8 bytes before a block of size 48 alloc'd
==52813== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==52813== by 0x4BA28B: js::DecompileValueGenerator(JSContext*, int, JS::Handle<JS::Value>, JS::Handle<JSString*>, int) (Utility.h:157)
==52813== by 0x437C08: js_ReportValueErrorFlags(JSContext*, unsigned int, unsigned int, int, JS::Handle<JS::Value>, JS::Handle<JSString*>, char const*, char const*) (jscntxt.cpp:958)
==52813== by 0x490E80: js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) (jsinterp.cpp:242)
==52813== by 0x634D7B: js::mjit::stubs::SlowCall(js::VMFrame&, unsigned int) (InvokeHelpers.cpp:133)
==52813== by 0x621DB7: js::mjit::ic::NativeCall(js::VMFrame&, js::mjit::ic::CallICInfo*) (MonoIC.cpp:1008)
==52813== by 0x403AAA6: ???
==52813== by 0x5B64B6: js::mjit::EnterMethodJIT(JSContext*, js::StackFrame*, void*, JS::Value*, bool) (MethodJIT.cpp:1016)
==52813== by 0x5B665D: js::mjit::JaegerShot(JSContext*, bool) (MethodJIT.cpp:1074)
==52813== by 0x48F555: js::Interpret(JSContext*, js::StackFrame*, js::InterpMode) (jsinterp.cpp:2438)
==52813== by 0x5B64F3: js::mjit::EnterMethodJIT(JSContext*, js::StackFrame*, void*, JS::Value*, bool) (MethodJIT.cpp:1043)
==52813== by 0x5B665D: js::mjit::JaegerShot(JSContext*, bool) (MethodJIT.cpp:1074)
S-s due to possible out-of-bounds read with unknown impact.
Whiteboard: [jsbugmon:update,bisect]
Reporter | ||
Updated•12 years ago
|
Whiteboard: [jsbugmon:update,bisect] → [jsbugmon:update]
Reporter | ||
Comment 2•12 years ago
|
||
JSBugMon: Bisection requested, result:
autoBisect shows this is probably related to the following changeset:
The first bad revision is:
changeset: 103051:bf07c6253287
user: Brian Hackett
date: Wed Aug 22 12:28:34 2012 -0600
summary: Allow purging analysis-temporary while retaining jitcode, bug 778724. r=luke
Updated•12 years ago
|
Whiteboard: [jsbugmon:update] → [jsbugmon:update][js:t]
Reporter | ||
Comment 4•12 years ago
|
||
Assuming sec-high due to invalid read.
Keywords: csec-bounds,
sec-high
Assigning to Brian per comment 2, feel free to reassign if you're not a good owner.
Assignee: general → bhackett1024
Comment 6•12 years ago
|
||
I can still reproduce on a recent m-c tip changeset c8a1314aa449 with -a on Mac 10.8 64-bit js shell with determinism disabled.
Reporter | ||
Updated•12 years ago
|
Whiteboard: [jsbugmon:update][js:t] → [js:t] [jsbugmon:]
Reporter | ||
Comment 7•12 years ago
|
||
JSBugMon: Cannot process bug: Unknown exception (check manually)
Reporter | ||
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:] → [js:t] [jsbugmon:update]
Reporter | ||
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:update] → [js:t] [jsbugmon:update,ignore]
Reporter | ||
Comment 8•12 years ago
|
||
JSBugMon: The testcase found in this bug no longer reproduces (tried revision 712eca11a04e).
Reporter | ||
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:update,ignore] → [js:t] [jsbugmon:bisectfix]
Reporter | ||
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:bisectfix] → [js:t] [jsbugmon:]
Reporter | ||
Comment 9•12 years ago
|
||
JSBugMon: Fix Bisection requested, result:
autoBisect shows this is probably related to the following changeset:
The first good revision is:
changeset: 118999:39885ae3a597
user: Brendan Eich
date: Tue Jan 15 18:17:50 2013 -0800
summary: Bug 810525 - unregress DecompileValueGenerator change to handle object literal reference bases (r=jandem).
This iteration took 107.488 seconds to run.
Reporter | ||
Comment 10•12 years ago
|
||
Brendan, did the fix in comment 9 fix this security issue?
Flags: needinfo?(brendan)
Reporter | ||
Comment 11•12 years ago
|
||
Asking Jan instead for comment 9/10.
Flags: needinfo?(brendan) → needinfo?(jdemooij)
Assignee | ||
Comment 12•12 years ago
|
||
Yeah, that bug added a missing bounds check and avoids using the decompiler if JM lowered fun.apply (the testcase in comment 0 uses fun.apply).
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: needinfo?(jdemooij)
Resolution: --- → FIXED
Reporter | ||
Comment 14•12 years ago
|
||
Flags: in-testsuite+
Reporter | ||
Updated•12 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 15•12 years ago
|
||
JSBugMon: This bug has been automatically verified fixed.
Reporter | ||
Comment 16•12 years ago
|
||
Should have checked first that this doesn't need uplifting, but it seems it does... Checking affected branches now.
Whiteboard: [js:t] [jsbugmon:] → [js:t] [jsbugmon:verify-branch=mozilla-aurora;mozilla-beta;mozilla-release;mozilla-esr17]
Reporter | ||
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:verify-branch=mozilla-aurora;mozilla-beta;mozilla-release;mozilla-esr17] → [js:t] [jsbugmon:verify-branch=mozilla-aurora;mozilla-beta;mozilla-release;mozilla-esr17,ignore]
Reporter | ||
Comment 17•12 years ago
|
||
JSBugMon: The testcase found in this bug does not reproduce on branch mozilla-aurora (tried revision bb20a6500778).
JSBugMon: This bug has been automatically confirmed to be still valid on branch mozilla-beta (reproduced on revision ceaba6121750).
JSBugMon: This bug has been automatically confirmed to be still valid on branch mozilla-release (reproduced on revision 1f29514cd560).
JSBugMon: This bug has been automatically confirmed to be still valid on branch mozilla-esr17 (reproduced on revision 659ce2b0bb83).
Reporter | ||
Comment 18•12 years ago
|
||
Nominating for affected branches based on comment 17.
status-b2g18:
--- → affected
status-firefox19:
--- → affected
status-firefox20:
--- → affected
status-firefox21:
--- → fixed
status-firefox22:
--- → fixed
status-firefox-esr17:
--- → affected
tracking-b2g18:
--- → ?
tracking-firefox19:
--- → ?
tracking-firefox20:
--- → ?
tracking-firefox-esr17:
--- → ?
Whiteboard: [js:t] [jsbugmon:verify-branch=mozilla-aurora;mozilla-beta;mozilla-release;mozilla-esr17,ignore] → [js:t] [jsbugmon:]
Comment 19•12 years ago
|
||
Brian is this also 17/18 affected? What is the proposed fix for branches and what is the risk? This doesn't look necessary for FF20 given that it looks to be a long-standing issue so please let us know if we're not reading this correctly.
Flags: needinfo?(bhackett1024)
Reporter | ||
Comment 20•12 years ago
|
||
esr17 is affected by comment 17. I nominated this because dveditz told me to do so, after I accidentially landed the test already now, although the fix hadn't been uplifted.
Updated•12 years ago
|
Depends on: 810525
Whiteboard: [js:t] [jsbugmon:] → [js:t] [jsbugmon:] fixed by bug 810525
Comment 21•12 years ago
|
||
If we take the fix in bug 810525 then we also need the fix for security bug 831846 and compiler warning bug 831205, and will introduce unfixed bug 850949. It's also possible that the changes in bug 810525 will cause additional problems when backported since we don't know if they depend on other changes between Firefox 17 and 21.
Comment 22•12 years ago
|
||
The testcase does not crash a release ESR 17.0.4, we can hope that people won't discover the underlying issue merely from the checked-in test.
Reporter | ||
Comment 23•12 years ago
|
||
(In reply to Daniel Veditz [:dveditz] from comment #22)
> The testcase does not crash a release ESR 17.0.4, we can hope that people
> won't discover the underlying issue merely from the checked-in test.
Are you sure you run it the right way? JSBugMon confirmed this on ESR17.
Comment 24•12 years ago
|
||
(In reply to lsblakk@mozilla.com from comment #19)
> Brian is this also 17/18 affected? What is the proposed fix for branches and
> what is the risk? This doesn't look necessary for FF20 given that it looks
> to be a long-standing issue so please let us know if we're not reading this
> correctly.
Jan would know more. The original blame for this bug is wrong, bug 778724 doesn't have anything to do with this failure.
Flags: needinfo?(bhackett1024)
Comment 25•12 years ago
|
||
(In reply to Christian Holler (:decoder) from comment #14)
> Added the test:
>
> https://hg.mozilla.org/integration/mozilla-inbound/rev/eaf0e938db6d
https://hg.mozilla.org/mozilla-central/rev/eaf0e938db6d
Target Milestone: --- → mozilla22
Updated•12 years ago
|
Flags: in-testsuite+
Comment 26•12 years ago
|
||
So is this really fixed on 21? Also we should uplift to b2g18 due to security level.
Comment 28•12 years ago
|
||
jandem - can bug 810525 be uplifted to ESR17/B2G18?
Assignee | ||
Comment 29•12 years ago
|
||
I think this is the right fix for esr17. It falls back to the stack search if spindex is out-of-range. Note that we already have the exact same check on mozilla-central, so this should be very low-risk.
Attachment #732395 -
Flags: review?(bhackett1024)
Flags: needinfo?(jdemooij)
Updated•12 years ago
|
Attachment #732395 -
Flags: review?(bhackett1024) → review+
Comment 30•12 years ago
|
||
Please nominate for uplift to ESR/B2G when you get the chance. Thanks!
Assignee | ||
Comment 31•12 years ago
|
||
Comment on attachment 732395 [details] [diff] [review]
Patch for esr17
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bisection points to bug 778724, but likely existed before that.
User impact if declined: Security issues, crashes.
Testing completed: Exact same code is on beta, aurora and m-c.
Risk to taking this patch (and alternatives if risky): Very low.
String or UUID changes made by this patch: None.
[Approval Request Comment]
If this is not a sec:{high,crit} bug, please state case for ESR consideration:
User impact if declined: Security issues, crashes.
Fix Landed on Version: Exact same code is on beta, aurora and m-c.
Risk to taking this patch (and alternatives if risky): Very low.
String or UUID changes made by this patch: None.
Attachment #732395 -
Flags: approval-mozilla-esr17?
Attachment #732395 -
Flags: approval-mozilla-b2g18?
Updated•12 years ago
|
Attachment #732395 -
Flags: approval-mozilla-esr17?
Attachment #732395 -
Flags: approval-mozilla-esr17+
Attachment #732395 -
Flags: approval-mozilla-b2g18?
Attachment #732395 -
Flags: approval-mozilla-b2g18+
Comment 32•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g18/rev/e92cfa71f35f
https://hg.mozilla.org/releases/mozilla-esr17/rev/558830cbccd9
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → affected
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:] fixed by bug 810525 → [js:t] [jsbugmon:][adv-main21+] fixed by bug 810525
Updated•12 years ago
|
Whiteboard: [js:t] [jsbugmon:][adv-main21+] fixed by bug 810525 → [js:t] [jsbugmon:][adv-main21+][adv-esr1706+] fixed by bug 810525
Comment 33•12 years ago
|
||
Reproduced on FF17.0.5esr
Confirmed fixed on FF17.0.6esr candidate build 1
Confirmed fixed on FF21 candidate build 2
Confirmed fixed on FF22 2013-05-09
Confirmed fixed on FF23 2013-05-09
Updated•11 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•