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

can not run java after granting posix capabilities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 7
    • tools
    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.7.0_02"
      Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)


      FULL OS VERSION :
      Linux fedora 2.6.35.14-106.fc14.x86_64


      A DESCRIPTION OF THE PROBLEM :
      After granting the java executable cap_net_raw capabilities, java can not be executed, it reports the error:

      /opt/linux-x86_64/jdk1.7.0_02//bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

      After removing the capability, it works fine.

      see also 6919633


      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      cd $JAVA_HOME/bin
      sudo setcap cap_net_raw+epi ./java
      ./java -version

      Result:
      /opt/linux-x86_64/jdk1.7.0_02//bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected: after setting capaility, java should run with that capability (in this case by setting cap_net_raw java program should be able to run JNI libraries that perform actions that are allowed only when cap_net_raw is granted, such as set SO_BINDTODEVICE socket option)

      Actual: java fails to start, reporting
      /opt/linux-x86_64/jdk1.7.0_02//bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      /opt/linux-x86_64/jdk1.7.0_02//bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      instead of setting capability, we have to run java as root, which is not acceptable.

            ksrini Kumar Srinivasan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: