You&#x27;re right insofar as you can&#x27;t use the chroot command to escape a &quot;chroot jail&quot; because it automatically calls chdir() for you, but any root user can escape one by invoking the following linux system calls:<p><pre><code>  chdir(&quot;&#x2F;&quot;); &#x2F;* go to &#x2F; of &quot;chroot jail&quot; *&#x2F;
  mkdir(&quot;foo&quot;, ...); &#x2F;* create directory in jail *&#x2F;
  chroot(&quot;foo&quot;); &#x2F;* change &#x2F; to foo *&#x2F;
  &#x2F;* fail to chdir(&quot;foo&quot;); *&#x2F;
  chdir(&quot;..&quot;); &#x2F;* instead go up parent (there is nothing preventing you since you are no longer in the &quot;chroot jail&quot; since the jail is now foo and you never entered it) *&#x2F;
  chdir(&quot;..&quot;);
  &#x2F;* ... *&#x2F;
  chdir(&quot;..&quot;); &#x2F;* . is now the real root *&#x2F;
  chroot(&quot;.&quot;); &#x2F;* change &#x2F; to the real root *&#x2F;
</code></pre>
This is why the man pages for the linux system call rightfully put &quot;chroot jail&quot; in scare quotes.  They are trivially escaped by a root user making basic linux system calls, and the man pages even sketch out how for you.  Some operating systems attempt to provide more secure chroot jails, but linux chroot() does not provide this.