···177177 case NS_GET_TGID_FROM_PIDNS:178178 case NS_GET_PID_IN_PIDNS:179179 case NS_GET_TGID_IN_PIDNS:180180+ case NS_GET_ID:180181 return true;181182 }182183···227226 argp = (uid_t __user *) arg;228227 uid = from_kuid_munged(current_user_ns(), user_ns->owner);229228 return put_user(uid, argp);230230- case NS_GET_MNTNS_ID: {231231- __u64 __user *idp;232232- __u64 id;233233-234234- if (ns->ops->type != CLONE_NEWNS)235235- return -EINVAL;236236-237237- mnt_ns = container_of(ns, struct mnt_namespace, ns);238238- idp = (__u64 __user *)arg;239239- id = mnt_ns->ns.ns_id;240240- return put_user(id, idp);241241- }242229 case NS_GET_PID_FROM_PIDNS:243230 fallthrough;244231 case NS_GET_TGID_FROM_PIDNS:···271282 if (!ret)272283 ret = -ESRCH;273284 return ret;285285+ }286286+ case NS_GET_MNTNS_ID:287287+ if (ns->ops->type != CLONE_NEWNS)288288+ return -EINVAL;289289+ fallthrough;290290+ case NS_GET_ID: {291291+ __u64 __user *idp;292292+ __u64 id;293293+294294+ idp = (__u64 __user *)arg;295295+ id = ns->ns_id;296296+ return put_user(id, idp);274297 }275298 }276299
+4-2
include/uapi/linux/nsfs.h
···1616#define NS_GET_NSTYPE _IO(NSIO, 0x3)1717/* Get owner UID (in the caller's user namespace) for a user namespace */1818#define NS_GET_OWNER_UID _IO(NSIO, 0x4)1919-/* Get the id for a mount namespace */2020-#define NS_GET_MNTNS_ID _IOR(NSIO, 0x5, __u64)2119/* Translate pid from target pid namespace into the caller's pid namespace. */2220#define NS_GET_PID_FROM_PIDNS _IOR(NSIO, 0x6, int)2321/* Return thread-group leader id of pid in the callers pid namespace. */···3941#define NS_MNT_GET_NEXT _IOR(NSIO, 11, struct mnt_ns_info)4042/* Get previous namespace. */4143#define NS_MNT_GET_PREV _IOR(NSIO, 12, struct mnt_ns_info)4444+4545+/* Retrieve namespace identifiers. */4646+#define NS_GET_MNTNS_ID _IOR(NSIO, 5, __u64)4747+#define NS_GET_ID _IOR(NSIO, 13, __u64)42484349enum init_ns_ino {4450 IPC_NS_INIT_INO = 0xEFFFFFFFU,