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

[JVMCI] do not use system properties for querying OS name and arch

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • tbd
    • 21
    • hotspot

    Description

      JVMCI uses the os.name and os.arch system properties for configuration purposes (e.g. choosing ABI calling convention). It is protected from an app that modifies these properties via System.setProperty() as JVMCI uses jdk.internal.misc.VM.getSavedProperties(). However, it's still a problem if this property is misconfigured on the VM command line. This is shown by the java/foreign/TestFallbackLookup test which sets -Dos.name=Windows on the command line[1]. JVMCI should use jdk.internal.util.OperatingSystem and jdk.internal.util.Architecture instead.

      [1] https://github.com/openjdk/jdk/blob/4460429d7a50b9a7a99058ef4e5ae36fb30b956f/test/jdk/java/foreign/TestFallbackLookup.java#L28

      Attachments

        Issue Links

          Activity

            People

              dnsimon Douglas Simon
              dnsimon Douglas Simon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: