このブログはURLが変更になりました

新しいブログはこちら→ https://matsuu.hatenablog.com/

セキュリティ目的のchrootは意味がない

KernelTrapより、Abusing chroot

If you are within chroot jail and capable of chroot(), you can chdir to its root, then chroot() to subdirectory and you've got cwd outside of your new root. After that you can chdir all way out to original root. Again, this is standard behaviour. Changing it will not yield any security improvements, so kindly give that a rest.

要約すれば、「chrootなんて簡単に抜けられるからセキュリティ目的で使っても意味ないよ。」ってことね。そうだったのか。

ディストリビューションによってはchroot環境用のbindパッケージとか用意されてるけど、気安め程度にしかならないってことですはい。