Re: [CRIU] Introspecting userns relationships to other namespaces?

From: W. Trevor King
Date: Wed Jul 13 2016 - 00:00:20 EST

On Tue, Jul 12, 2016 at 05:08:43PM -0700, Andrew Vagin wrote:
> Here is a patch to get an owning user namespace:
> Here is an example how it looks from user-space:

Overall this looks good to me (I left a handful of uninformed comments
inline ;).

It doesn't make it easy to walk leafward, but it doesn't look like the
kernel has a convenient way to list child namespaces either.
Something like /proc/<pid>/task/<tid>/children (with
CONFIG_PROC_CHILDREN) for namespaces would make it easier to get a
complete system overview (as far as your credentials and position in
the namespace hierarchies allow). But looking at the
CONFIG_PROC_CHILDREN implementation doesn't make me all that excited
about mimicking it for namespaces ;).

You can still brute-force it in userspace by walking the root-most
procfs's you can find and peeking at all the /proc/<pid>/ns/â entries
(but yuck ;). With mount and other namespaces not being hierarchical,
the âleafwordâ idea may not be all that useful anyway, but having a
more compact collection of mount namepaces (say) that you know about
would be nice. Where âknow aboutâ should probably means âknow it
existsâ but not necessarily âhave permission to enterâ. Still,
getting that figured out can happen independently to this parent/owner


This email may be signed or encrypted with GnuPG (
For more information, see

Attachment: signature.asc
Description: OpenPGP digital signature