chroot and /proc/self
Posted: Fri Jan 01, 2010 3:26 pm
Hiho,
I'm running an amd64 2.6.28 hardened gentoo server with a chroot to compile software for client machines. Now in the chroot, javac keeps failing (for example when compiling xulrunner), because it can't find libjli.so. Turns out that in order to find that lib, it reads several files under /proc/self (because libjli.so is not installed in a standard path). Reproducing that error when running javac from the console seems to work only randomly, but once it did, strace showed that reading /proc/self returned ENOENT. So to me this looks like there's some problem with the /proc/self symlink in a hardened chroot. Looks like sometimes it isn't updated correctly and sometimes it doesn't even exist for a certain process. However this behaviour is only rarely seen when investigating from the console.
Has anyone heard of this? Any idea if this could be related to some sysctl or paxctl settings?
Oh and btw, now after trying for about the 5th time, compiling xulrunner magically worked. This really looks like a race condition or something. Thanks for any hints.
I'm running an amd64 2.6.28 hardened gentoo server with a chroot to compile software for client machines. Now in the chroot, javac keeps failing (for example when compiling xulrunner), because it can't find libjli.so. Turns out that in order to find that lib, it reads several files under /proc/self (because libjli.so is not installed in a standard path). Reproducing that error when running javac from the console seems to work only randomly, but once it did, strace showed that reading /proc/self returned ENOENT. So to me this looks like there's some problem with the /proc/self symlink in a hardened chroot. Looks like sometimes it isn't updated correctly and sometimes it doesn't even exist for a certain process. However this behaviour is only rarely seen when investigating from the console.
Has anyone heard of this? Any idea if this could be related to some sysctl or paxctl settings?
Oh and btw, now after trying for about the 5th time, compiling xulrunner magically worked. This really looks like a race condition or something. Thanks for any hints.