Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: src/crankshaft/ia32/lithium-codegen-ia32.cc

Issue 1521953002: [proxies] fix access issue when having proxies on the prototype-chain of global objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: better comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ia32/lithium-codegen-ia32.cc
diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.cc b/src/crankshaft/ia32/lithium-codegen-ia32.cc
index 1ede1f22b6bf2e6df6c144f03efab25dee73b2b0..6986d53816cf240ddc37f8352705ec0550034936 100644
--- a/src/crankshaft/ia32/lithium-codegen-ia32.cc
+++ b/src/crankshaft/ia32/lithium-codegen-ia32.cc
@@ -2540,6 +2540,11 @@ void LCodeGen::DoHasInPrototypeChainAndBranch(
__ mov(object_map, FieldOperand(object, HeapObject::kMapOffset));
Label loop;
__ bind(&loop);
+ // If we find a JSProxy during the prototype chain walk we deopt. It is
+ // important to note that we restart the lookup in the InstanceOfStub as
+ // continuing the iteration on the JSProxy would lead to a potential security
+ // issue by executing the getPrototypeOf trap of a cross-realm proxy-object
+ // without performing the necessary access checks first.
Camillo Bruni 2015/12/14 19:59:20 probably should add this comment to all platforms.
Toon Verwaest 2015/12/14 20:06:48 There's still a silly issue. If you have: window2.
Camillo Bruni 2015/12/15 14:09:26 fixed that now as well...
__ CmpInstanceType(object_map, JS_PROXY_TYPE);
DeoptimizeIf(equal, instr, Deoptimizer::kProxy);
__ mov(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset));
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698