<div dir="ltr">Hello all, <div>Greeting and happy new year to all.</div><div>I am trying to sandbox a java application using selinux sandbox.</div><div>System details: Redhat 6 | x86_64 | no x server install | jdk7 from oracle tar.gz version | cgred and cgconfig are stop </div><div>The cmd (run as root)</div><div><i>         sandbox /root/jdk/bin/java -version</i></div><div>above cmd failed with </div><div><i>         /root/jdk/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory</i><br></div><div><br></div><div>Digging, revealed that &quot;libjli.so&quot; is RPATH shared library. so i thought ok since sandbox is copying my bin/java to /tmp/sandbox_random therefore a hardcode path will not be found.</div><div>Then i change the RPATH using &quot;chrpath&quot; utility and changed it to a hardcode value</div><div>But still it showed the same error.</div><div><br></div><div>Then i used the -M -i option of sandbox and ran following command (i included all the .so file it complaint about):</div><div><i>      sandbox -M -i /root/jdk/lib/amd64/jli/libjli.so -i /root/jdk/jre/lib/amd64/libjava.so -i /root/jdk/jre/lib/amd64/jvm.cfg -i /root/jdk/jre/lib/amd64/server/libjvm.so -i    /root/jdk/jre/lib/amd64/libverify.so -i /root/jdk/jre/lib/amd64/libzip.so /root/jdk/bin/java  -version<br></i></div><div><br></div><div>Following command resulted in this error:</div><div><div><i>Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fb039000000, 2555904, 1) failed; error=&#39;Permission denied&#39; (errno=13)</i></div><div><i>#</i></div><div><i># There is insufficient memory for the Java Runtime Environment to continue.</i></div><div><i># Native memory allocation (malloc) failed to allocate 2555904 bytes for committing reserved memory.</i></div><div><i># An error report file with more information is saved as:</i></div><div><i># /root/hs_err_pid1270.log</i></div></div><div><br></div><div>Now i used the strace to see what happened and strace printed(small section) </div><div><div><i>clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fb15b6359d0) = 8268</i></div><div><i>close(4)                                = 0</i></div><div><i>read(3, &quot;&quot;, 1048576)                    = 0</i></div><div><i>close(3)                                = 0</i></div><div><i>wait4(8268, Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f4579000000, 2555904, 1) failed; error=&#39;Permission denied&#39; (errno=13)</i></div></div><div><br></div><div>I have enough space for sure</div><div><br></div><div><b><i>Can you guys please indicate what might be wrong ?</i></b></div></div>