proc: Usable inode numbers for the namespace file descriptors.
Assign a unique proc inode to each namespace, and use that
inode number to ensure we only allocate at most one proc
inode for every namespace in proc.
A single proc inode per namespace allows userspace to test
to see if two processes are in the same namespace.
This has been a long requested feature and only blocked because
a naive implementation would put the id in a global space and
would ultimately require having a namespace for the names of
namespaces, making migration and certain virtualization tricks
impossible.
We still don't have per superblock inode numbers for proc, which
appears necessary for application unaware checkpoint/restart and
migrations (if the application is using namespace file descriptors)
but that is now allowd by the design if it becomes important.
I have preallocated the ipc and uts initial proc inode numbers so
their structures can be statically initialized.
Signed-off-by:
Eric W. Biederman <ebiederm@xmission.com>
Showing
- fs/mount.h 1 addition, 0 deletionsfs/mount.h
- fs/namespace.c 14 additions, 0 deletionsfs/namespace.c
- fs/proc/namespaces.c 14 additions, 10 deletionsfs/proc/namespaces.c
- include/linux/ipc_namespace.h 2 additions, 0 deletionsinclude/linux/ipc_namespace.h
- include/linux/pid_namespace.h 1 addition, 0 deletionsinclude/linux/pid_namespace.h
- include/linux/proc_fs.h 6 additions, 1 deletioninclude/linux/proc_fs.h
- include/linux/user_namespace.h 1 addition, 0 deletionsinclude/linux/user_namespace.h
- include/linux/utsname.h 1 addition, 0 deletionsinclude/linux/utsname.h
- include/net/net_namespace.h 2 additions, 0 deletionsinclude/net/net_namespace.h
- init/version.c 2 additions, 0 deletionsinit/version.c
- ipc/msgutil.c 2 additions, 0 deletionsipc/msgutil.c
- ipc/namespace.c 16 additions, 0 deletionsipc/namespace.c
- kernel/pid.c 1 addition, 0 deletionskernel/pid.c
- kernel/pid_namespace.c 12 additions, 0 deletionskernel/pid_namespace.c
- kernel/user.c 2 additions, 0 deletionskernel/user.c
- kernel/user_namespace.c 15 additions, 0 deletionskernel/user_namespace.c
- kernel/utsname.c 16 additions, 1 deletionkernel/utsname.c
- net/core/net_namespace.c 24 additions, 0 deletionsnet/core/net_namespace.c
Loading
Please register or sign in to comment