Details
Description
javaClasses.cpp:
bool java_lang_System::allow_security_manager() {
static int initialized = false;
static bool allowed = true; // default
if (!initialized) {
oop base = vmClasses::System_klass()->static_field_base_raw();
int never = base->int_field(_static_never_offset);
allowed = (base->int_field(_static_allow_security_offset) != never);
}
return allowed;
}
We never set `initialized` to true, so every call to allow_security_manager() re-reads the System class field.
bool java_lang_System::allow_security_manager() {
static int initialized = false;
static bool allowed = true; // default
if (!initialized) {
oop base = vmClasses::System_klass()->static_field_base_raw();
int never = base->int_field(_static_never_offset);
allowed = (base->int_field(_static_allow_security_offset) != never);
}
return allowed;
}
We never set `initialized` to true, so every call to allow_security_manager() re-reads the System class field.
Attachments
Issue Links
- relates to
-
JDK-8195744 Avoid calling ClassLoader.checkPackageAccess if security manager is not installed
-
- Resolved
-