summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Class.cc
diff options
context:
space:
mode:
author Andrei-Valentin Onea <andreionea@google.com> 2020-01-14 15:40:09 +0000
committer Lokesh Gidra <lokeshgidra@google.com> 2020-01-14 21:37:43 +0000
commit9406c43b2de9b94b6d70f82474840eccd7699dc7 (patch)
tree5bc44e726bf2a8d0a6e37279056c3f226154afc6 /runtime/native/java_lang_Class.cc
parent08d064fb6d02006730710a683e84a4cc54229c67 (diff)
Revert "Harden hidden api checks."
Revert submission 1203343-hidden-api-check-hardening Reason for revert: art-asan target failure Reverted Changes: I5af9f79f5: Add change id for hidden api check hardening Ifc8d39ba2: Harden hidden api checks. Change-Id: Ifb824ff00cb78f03cd388c56dd7411f5c51bb531
Diffstat (limited to 'runtime/native/java_lang_Class.cc')
-rw-r--r--runtime/native/java_lang_Class.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 11399c07ba..da87713d54 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -55,17 +55,12 @@
namespace art {
-// Should be the same as dalvik.system.VMRuntime.HIDDEN_API_CHECK_HARDENING.
-// Corresponds to a bug id.
-static constexpr uint64_t kHiddenApiCheckHardeningId = 142365358;
-
// Walks the stack, finds the caller of this reflective call and returns
// a hiddenapi AccessContext formed from its declaring class.
static hiddenapi::AccessContext GetReflectionCaller(Thread* self)
REQUIRES_SHARED(Locks::mutator_lock_) {
- // Walk the stack and find the first frame not from java.lang.Class,
- // java.lang.invoke or java.lang.reflect. This is very expensive.
- // Save this till the last.
+ // Walk the stack and find the first frame not from java.lang.Class and not
+ // from java.lang.invoke. This is very expensive. Save this till the last.
struct FirstExternalCallerVisitor : public StackVisitor {
explicit FirstExternalCallerVisitor(Thread* thread)
: StackVisitor(thread, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
@@ -98,13 +93,6 @@ static hiddenapi::AccessContext GetReflectionCaller(Thread* self)
&& !m->IsClassInitializer()) {
return true;
}
- // Check for classes in the java.lang.reflect package.
- if (Runtime::Current()->isChangeEnabled(kHiddenApiCheckHardeningId)) {
- ObjPtr<mirror::Class> method_class = GetClassRoot<mirror::Method>();
- if (declaring_class->IsInSamePackage(method_class)) {
- return true;
- }
- }
}
caller = m;