Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272608

java_lang_System::allow_security_manager() doesn't set its initialization flag

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b09
    • Introduced In Version:
      17
    • Resolved In Build:
      b15

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              msaavedrasil Matias Saavedra Silva (Inactive)
              Reporter:
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: