Closed
Bug 974751
Opened 11 years ago
Closed 11 years ago
Crash [@ ArgGetter] or [@ js::Shape::get] or Assertion failure: hasScript(), at jsfun.h
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
mozilla30
Tracking | Status | |
---|---|---|
firefox27 | --- | unaffected |
firefox28 | --- | unaffected |
firefox29 | + | fixed |
firefox30 | + | fixed |
firefox-esr24 | --- | unaffected |
People
(Reporter: gkw, Assigned: till)
References
Details
(5 keywords, Whiteboard: [jsbugmon:update])
Crash Data
Attachments
(3 files)
7.42 KB,
text/plain
|
Details | |
10.13 KB,
text/plain
|
Details | |
2.21 KB,
patch
|
jandem
:
review+
abillings
:
approval-mozilla-aurora+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
s = newGlobal();
evalcx("\
function g(i) {\
eval(\"x = arguments\")\
}\
g(0, 0);\
", s)
gc();
gc();
evalcx("Array.prototype.reverse.call(x);", s);
asserts js debug shell on m-c changeset 660b62608951 without any CLI arguments at Assertion failure: hasScript(), at js/src/jsfun.h
s-s because gc is involved.
My configure flags are:
CC="clang -Qunused-arguments" AR=ar CXX="clang++ -Qunused-arguments" sh ./configure --target=x86_64-apple-darwin12.5.0 --enable-optimize --enable-debug --enable-profiling --enable-gczeal --enable-debug-symbols --enable-methodjit --enable-type-inference --disable-tests --enable-more-deterministic --enable-exact-rooting --with-ccache --enable-threadsafe <other NSPR options>
autoBisect shows this is probably related to the following changeset:
The first bad revision is:
changeset: http://hg.mozilla.org/mozilla-central/rev/508ad49212c0
user: Till Schneidereit
date: Thu Dec 19 14:07:24 2013 +0100
summary: Bug 886193 - Part 3: Relazify non-JITted JSFunctions on GC. r=jandem
Flags: needinfo?(till)
Assignee | ||
Comment 1•11 years ago
|
||
Reproduces with a normal debug shell without any special configure or runtime flags. Looking into it.
Reporter | ||
Comment 2•11 years ago
|
||
s = newGlobal()
evalcx("\
(function(x,y) {\
eval(\"a=arguments\")\
})(0,0)\
", s)
gc()
evalcx("1 instanceof a", s)
crashes js opt shell on m-c rev b89a9d7b4ca0 on Mac at ArgGetter with js::Shape::get on the stack.
LD=ld CROSS_COMPILE=1 CXX="clang++ -Qunused-arguments -arch i386" RANLIB=ranlib CC="clang -Qunused-arguments -arch i386" AS=$CC AR=ar STRIP="strip -x -S" HOST_CC="clang -Qunused-arguments" HOST_CXX="clang++ -Qunused-arguments" sh ./configure --target=i386-apple-darwin9.2.0 --enable-macos-target=10.5 --enable-optimize --disable-debug --enable-profiling --enable-gczeal --enable-debug-symbols --enable-methodjit --enable-type-inference --disable-tests --enable-more-deterministic --enable-exact-rooting --with-ccache --enable-threadsafe <other NSPR flags>
This is all the more likely to be s-s because memory address 0x03300000 seems to be accessed.
Reporter | ||
Updated•11 years ago
|
Crash Signature: [@ ArgGetter]
[@ js::Shape::get]
status-firefox27:
--- → unaffected
status-firefox28:
--- → unaffected
status-firefox29:
--- → affected
status-firefox30:
--- → affected
status-firefox-esr24:
--- → unaffected
tracking-firefox29:
--- → ?
tracking-firefox30:
--- → ?
Keywords: crash
Summary: Assertion failure: hasScript(), at js/src/jsfun.h → Crash [@ ArgGetter] or [@ js::Shape::get] or Assertion failure: hasScript(), at js/src/jsfun.h
Assignee | ||
Comment 3•11 years ago
|
||
Hrng, this is actually kinda bad. What happens is that the `arguments` object escapes, the function is relazified, and then the `arguments` object is accessed, failing horribly.
This patch makes us not relazify functions that need an explicit arguments object. That's unfortunate, as most of them would be fine, but AFAIK, we don't have a way to tell.
However, in a medium-weight browsing session, I had 299 needlessly-relazified function, out of 10s of thousands. So it's not that bad.
@Jandem, because I didn't get around to dealing with this any earlier, the timing is pretty unfortunate: I'm on vacation starting in a few hours. If I can't land this patch in time (including an uplift to Aurora), could you do that? Sorry for that, and thanks in advance.
Attachment #8383486 -
Flags: review?(jdemooij)
Comment 4•11 years ago
|
||
Comment on attachment 8383486 [details] [diff] [review]
Don't relazify functions whose 'arguments' object might escape.
Review of attachment 8383486 [details] [diff] [review]:
-----------------------------------------------------------------
Glad the fuzzers can test relazification (with newGlobal etc).
Attachment #8383486 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 8383486 [details] [diff] [review]
Don't relazify functions whose 'arguments' object might escape.
[Approval Request Comment]
Bug caused by (feature/regressing bug #): 886193
User impact if declined: Potentially-exploitable accesses of GC'd JSScripts
Testing completed (on m-c, etc.): manual testing completed, but not landed because of the s-s status.
Risk to taking this patch (and alternatives if risky): extremely low, adds checks to skip an optimization if it's invalid.
String or IDL/UUID changes made by this patch: none
This should land on Aurora at roughly the same time as on m-c. I would set checkin-needed, but I'm not 100% sure that won't cause it to accidentally be landed on m-c before Aurora.
Attachment #8383486 -
Flags: approval-mozilla-aurora?
Flags: needinfo?(till)
Comment 6•11 years ago
|
||
Standard tree rules are that this lands on trunk, *then* release branches. Not saying that can't happen in close proximity (it usually does anyway as long as the approvals are done), but simultaneous landing is something we generally try to avoid.
But it's a sec-high affecting multiple branches, so it needs sec-approval before it can land on trunk anyway.
Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 8383486 [details] [diff] [review]
Don't relazify functions whose 'arguments' object might escape.
[Security approval request comment]
How easily could an exploit be constructed based on the patch?
Given that invalid pointers are dereferenced in a loop, probably somewhat easy.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?
A "bulls-eye" - no. Hints, yes.
Which older supported branches are affected by this flaw?
Aurora
If not all supported branches, which bug introduced the flaw?
Bug 886193
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be?
The patch should apply as-is to Aurora.
How likely is this patch to cause regressions; how much testing does it need?
Extremely unlikely. It adds checks to skip an optimization if it's invalid.
Attachment #8383486 -
Flags: sec-approval?
Updated•11 years ago
|
Comment 8•11 years ago
|
||
Comment on attachment 8383486 [details] [diff] [review]
Don't relazify functions whose 'arguments' object might escape.
sec-approval+ for trunk and aurora approval.
Attachment #8383486 -
Flags: sec-approval?
Attachment #8383486 -
Flags: sec-approval+
Attachment #8383486 -
Flags: approval-mozilla-aurora?
Attachment #8383486 -
Flags: approval-mozilla-aurora+
Reporter | ||
Comment 9•11 years ago
|
||
Helping to land since Till will likely be on vacation.
https://hg.mozilla.org/integration/mozilla-inbound/rev/855f10e178e8
Target Milestone: --- → mozilla30
Comment 10•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 11•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/711dd14566d4
Can we land the test please?
Flags: in-testsuite?
Updated•11 years ago
|
Status: RESOLVED → VERIFIED
Crash Signature: [@ ArgGetter]
[@ js::Shape::get] → [@ ArgGetter]
[@ js::Shape::get]
Comment 12•11 years ago
|
||
JSBugMon: This bug has been automatically verified fixed.
Updated•11 years ago
|
Group: javascript-core-security
Reporter | ||
Updated•10 years ago
|
Crash Signature: [@ ArgGetter]
[@ js::Shape::get] → [@ ArgGetter]
[@ js::Shape::get]
Summary: Crash [@ ArgGetter] or [@ js::Shape::get] or Assertion failure: hasScript(), at js/src/jsfun.h → Crash [@ ArgGetter] or [@ js::Shape::get] or Assertion failure: hasScript(), at jsfun.h
Updated•9 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•