On Sat, Jan 30, 2016 at 04:31:06PM +0300, Yuriy M. Kaminskiy wrote: > >> + case 0: /* child */ > >> + do { > >> + /* wait until parent unshare() */ > >> + ino_t new_ino = get_mnt_ino(ppid); > >> + if (ino != new_ino) > >> + break; > >> + } while (1); > > > > Racing? Suppose, parent died (e.g. unshare(2) failed), (parent) process > > was reaped, new (unrelated) process was created with same pid, as a > > result this function will bind namespaces from wrong process. > > ... besides, this is a busyloop, if "imposer process" is in same mnt > namespace as original process, it will occupy CPU forever (and this *is* Would be possible to use any lightweight solution rather than pipe()+read/write(), for example use sigtimedwait() in child and kill() in parent? The ideal solution would be to have /proc/self/ns/<name> files poll()-able. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html