Closed
Bug 1463501
Opened 7 years ago
Closed 7 years ago
Assertion failure: !IsInsideNursery(cell), at js/src/jit/VMFunctions.cpp:695
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox-esr60 | --- | disabled |
firefox60 | --- | disabled |
firefox61 | --- | disabled |
firefox62 | --- | disabled |
People
(Reporter: gkw, Assigned: sfink)
References
Details
(6 keywords, Whiteboard: [fuzzblocker] [jsbugmon:])
Attachments
(2 files)
4.17 KB,
text/plain
|
Details | |
1.30 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
The following testcase crashes on mozilla-central revision b75acf965293 (build with --enable-debug --enable-more-deterministic, run with --fuzzing-safe --no-threads --ion-eager --nursery-strings=on):
function f(x) {
y = x.replace(/\s/g, " ");
return true & y.match(/l/) & y.match(/.*/)
}
f("");
f("for (v { for (let for ");
Backtrace:
#0 0x0000557aff5102d0 in js::jit::PostWriteBarrier (rt=0x7f2988c19000, cell=0x7f2988b009e8) at js/src/jit/VMFunctions.cpp:695
#1 0x00003d72abe2b97e in ?? ()
#2 0x00007fff002bdd40 in ?? ()
#3 0x00007fff002bdd38 in ?? ()
#4 0x00007fff002bdd50 in ?? ()
/snip
For detailed crash information, see attachment.
Setting s-s because this contains GC stuff on the stack.
![]() |
Reporter | |
Comment 1•7 years ago
|
||
![]() |
Reporter | |
Updated•7 years ago
|
Flags: needinfo?(sphink)
Flags: needinfo?(jcoppeard)
Whiteboard: [jsbugmon:update] → [jsbugmon:update,bisect]
![]() |
Reporter | |
Comment 2•7 years ago
|
||
This has blown up jsfunfuzz with different crashes involving arena_dalloc, JS::Zone::~Zone, js::gc::TenuredCell::writeBarrierPre and js::gc::ArenaCellSet::putCell all likely related.
Whiteboard: [jsbugmon:update,bisect] → [fuzzblocker][jsbugmon:update,bisect]
Updated•7 years ago
|
Whiteboard: [fuzzblocker][jsbugmon:update,bisect] → [fuzzblocker] [jsbugmon:bisect]
Comment 3•7 years ago
|
||
JSBugMon: Cannot process bug: Unable to automatically reproduce, please track manually.
Updated•7 years ago
|
Whiteboard: [fuzzblocker] [jsbugmon:bisect] → [fuzzblocker] [jsbugmon:]
Comment 4•7 years ago
|
||
Note this requires nursery strings enabled so is probably not a general problem.
Flags: needinfo?(jcoppeard)
Priority: -- → P3
Updated•7 years ago
|
status-firefox60:
--- → disabled
status-firefox61:
--- → disabled
status-firefox-esr52:
--- → unaffected
status-firefox-esr60:
--- → disabled
Assignee | ||
Comment 5•7 years ago
|
||
Yummy fuzzbug. Thanks.
Looks like I still don't have the JIT postbarrier code logic quite right yet -- it seems to be trying to postbarrier a tenured -> tenured edge.
Assignee | ||
Comment 6•7 years ago
|
||
Oops, I guess I should try actually running the code with nursery strings enabled.
Trivial fix. I would expect it to fail most of the time without this.
Attachment #8980146 -
Flags: review?(jdemooij)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•7 years ago
|
||
Oh, I meant to ask -- is there any way to avoid pushing all of the volatile MMX registers when calling PostWriteBarrier? I mean, I don't *know* that they won't be used. Is there some way to tell the compiler not to use them or something?
Flags: needinfo?(sphink)
Comment 8•7 years ago
|
||
Comment on attachment 8980146 [details] [diff] [review]
Fix string post barrier when writing string base field
Review of attachment 8980146 [details] [diff] [review]:
-----------------------------------------------------------------
Regarding volatile float registers: sadly there's no easy way to avoid that, AFAIK. Our best options are (1) ideally we'd add some kind of post-barrier trampoline where we can inline the most common post-barriers without calling into C++, a bit like what we did with the pre-barrier trampoline (bug 1419497 mentions slow pushing/popping of float registers as one of the reasons for adding that trampoline), (2) mark the post-barrier instruction as a call instruction so Ion's register allocator handles the spilling, or give the instruction a safepoint so we know the live registers. The latter might be more difficult for some cases.
Attachment #8980146 -
Flags: review?(jdemooij) → review+
Comment 9•7 years ago
|
||
(So if you want to work on that: I think having a post-barrier trampoline would be cool. Maybe some fixed-size buffer where we can append N entries, or something. It would also eliminate some code bloat: instead of pushing registers, calling the post barrier, popping registers, we would just call the trampoline directly and it would take care of saving registers when it calls into C++.)
Comment 10•7 years ago
|
||
(Oh the trampoline could look at the ArenaCellSet inline, similar to how the pre-barrier code checks for mark bits inline.. We'd want to collect some data on how frequently the "already in whole cell buffer" fast path would succeed/fail.)
Assignee | ||
Comment 11•7 years ago
|
||
Comment on attachment 8980146 [details] [diff] [review]
Fix string post barrier when writing string base field
I'll request sec-approval, but I think this should be sec-none in the first place: it only crashes in a non-default configuration that requires either an environment variable to enable, or (JS shell only) passing a command-line option.
[Security approval request comment]
How easily could an exploit be constructed based on the patch? not possible without also enabling nursery strings
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? no
Which older supported branches are affected by this flaw? none
How likely is this patch to cause regressions; how much testing does it need? it's a pretty obvious fix; it does dumb stuff left out, and skips the dumb stuff after adding the line.
Attachment #8980146 -
Flags: sec-approval?
If this is disabled by default on all branches, then you don't need sec-approval. And we could probably unhide the bug.
Assignee | ||
Comment 14•7 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #12)
> If this is disabled by default on all branches, then you don't need
> sec-approval. And we could probably unhide the bug.
Yes, it is disabled by default everywhere it exists.
Group: javascript-core-security
Assignee | ||
Updated•7 years ago
|
Attachment #8980146 -
Flags: sec-approval?
Comment 15•7 years ago
|
||
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b865f2b5fb12
Fix string post barrier when writing string base field, r=jandem
Comment 16•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Updated•7 years ago
|
Keywords: regression
You need to log in
before you can comment on or make changes to this bug.
Description
•