Closed
Bug 655921
Opened 14 years ago
Closed 14 years ago
Do CSP checks fast and early in Function function
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla6
People
(Reporter: Waldo, Assigned: Waldo)
References
(Depends on 1 open bug)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
3.10 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
Right now Function creates the function it'll return (minus its script), then it does CSP checks to see whether to reject the attempt to create dynamic code. And it does this by unconditionally calling the security callback, when it really should use GlobalObject::isEvalAllowed to take advantage of its cache of the eval-prohibited setting. It should check for prohibition first, then proceed to creating an object to return, and it should do so using the is-prohibited fast path.
This builds atop bug 655192 and bug 655907 for no particular reason beyond adding a new explicit-global NewFunction overload, which is the direction we need to start heading for all APIs that can create an object, in order to eventually fully fix bug 631135. I trust the minimal reliance on those patches (for the obviously-named GlobalObject::getOrCreateFunctionPrototype) won't present a difficulty.
Attachment #531225 -
Flags: review?(mrbkap)
Assignee | ||
Comment 1•14 years ago
|
||
It was tempting to rename isEvalAllowed, but that made the overlap with the other two bugs a bit more than I wanted, before those bugs land. That can be a followup or something, probably touches enough code to deserve it.
Comment 2•14 years ago
|
||
Comment on attachment 531225 [details] [diff] [review]
Patch
I was just going to suggest changing the function name when I saw comment 1!
Attachment #531225 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 3•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/6408576c8e08
Comment 1 is now bug 658069; I'll try to get to it shortly.
Whiteboard: fixed-in-tracemonkey
Target Milestone: --- → mozilla6
Comment 4•14 years ago
|
||
cdleary-bot mozilla-central merge info:
http://hg.mozilla.org/mozilla-central/rev/6408576c8e08
Updated•14 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•