Closed Bug 451657 Opened 17 years ago Closed 17 years ago

TM: use cx->executingTrace to prevent all js_Interpret re-entry from JITed builtins

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: brendan, Assigned: brendan)

References

Details

Summary says it all. Only way to be sure of coverage is to centralize the check and propagate a unique exception back to the builtin so it can fail to its guard. /be
Assignee: general → brendan
I landed an assertion at the top of js_Interpret: /* We had better not be entering the interpreter from JIT-compiled code. */ JS_ASSERT(!cx->runningJittedCode); after renaming gcDontBlock to runningJittedCode (agonized over spelling, this is easiest on the eyes ;-). If anyone sees this assertion botch, please attach a testcase. /be
Status: NEW → ASSIGNED
Blocks: 451666
Isn't that assert hit by the steps to reproduce in bug 451666? Note that it's not just built-ins. In bug 451666 we're calling a JS resolve hook from inside the tracer code directly, which leads to arbitrary script execution. So just fixing this bug may not fix the other if the fix is limited to builtins.
Yes, the true bug is not limited to built-ins. There are also call-outs from JSOP_ADD, etc., via OBJ_DEFAULT_VALUE, as well as the resolve hook, etc. Some of these should be made traceable by trampolining back to the interpreter. Others should do a deep abort. That's one reason I kept both bugs around. /be
Blocks: 452476
Look for the "!cx->runningJittedCode" assertbotch skidmark when marking bugs as dependents.. Dependents should have distinct stacks at least in the line number of the js_Interpret frame nearest top of stack. /be
Summary: TM: use cx->gcDontBlock to prevent all js_Interpret re-entry from JITed builtins → TM: use cx->gcDontBlock to prevent all js_Interpret re-entry from JITed builtins ("!cx->runningJittedCode" assertion)
Blake and I fixed this: http://wiki.ecmascript.org/doku.php?id=proposals:hashcodes I'm going to make bug 451666 be about the trampoline idea for all ops that can call indirectly back into js_Interpret. /be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Summary: TM: use cx->gcDontBlock to prevent all js_Interpret re-entry from JITed builtins ("!cx->runningJittedCode" assertion) → TM: use cx->executingTrace to prevent all js_Interpret re-entry from JITed builtins
Oops, shouldn't mark fixed until this is in mozilla-central. Blake, any hope of a weekend push? My cable internet is flaking... /be
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I could push this tomorrow. Others are welcome to jump in if that's not soon enough.
Shaver: oops, thanks -- copy didn't "take", d'oh. Probably worth a push ahead of the impending tracemonkey landing on m-c, for the nightly build kids' sake. /be
Status: REOPENED → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.