mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 02:49:05 +07:00
6786741dbf
Each namespace has an owning user namespace and now there is not way to discover these relationships. Understending namespaces relationships allows to answer the question: what capability does process X have to perform operations on a resource governed by namespace Y? After a long discussion, Eric W. Biederman proposed to use ioctl-s for this purpose. The NS_GET_USERNS ioctl returns a file descriptor to an owning user namespace. It returns EPERM if a target namespace is outside of a current user namespace. v2: rename parent to relative v3: Add a missing mntput when returning -EAGAIN --EWB Acked-by: Serge Hallyn <serge@hallyn.com> Link: https://lkml.org/lkml/2016/7/6/158 Signed-off-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
12 lines
230 B
C
12 lines
230 B
C
#ifndef __LINUX_NSFS_H
|
|
#define __LINUX_NSFS_H
|
|
|
|
#include <linux/ioctl.h>
|
|
|
|
#define NSIO 0xb7
|
|
|
|
/* Returns a file descriptor that refers to an owning user namespace */
|
|
#define NS_GET_USERNS _IO(NSIO, 0x1)
|
|
|
|
#endif /* __LINUX_NSFS_H */
|