hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/fs/proc/namespaces.c
....@@ -33,6 +33,10 @@
3333 #ifdef CONFIG_CGROUPS
3434 &cgroupns_operations,
3535 #endif
36
+#ifdef CONFIG_TIME_NS
37
+ &timens_operations,
38
+ &timens_for_children_operations,
39
+#endif
3640 };
3741
3842 static const char *proc_ns_get_link(struct dentry *dentry,
....@@ -42,22 +46,26 @@
4246 const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops;
4347 struct task_struct *task;
4448 struct path ns_path;
45
- void *error = ERR_PTR(-EACCES);
49
+ int error = -EACCES;
4650
4751 if (!dentry)
4852 return ERR_PTR(-ECHILD);
4953
5054 task = get_proc_task(inode);
5155 if (!task)
52
- return error;
56
+ return ERR_PTR(-EACCES);
5357
54
- if (ptrace_may_access(task, PTRACE_MODE_READ_FSCREDS)) {
55
- error = ns_get_path(&ns_path, task, ns_ops);
56
- if (!error)
57
- nd_jump_link(&ns_path);
58
- }
58
+ if (!ptrace_may_access(task, PTRACE_MODE_READ_FSCREDS))
59
+ goto out;
60
+
61
+ error = ns_get_path(&ns_path, task, ns_ops);
62
+ if (error)
63
+ goto out;
64
+
65
+ error = nd_jump_link(&ns_path);
66
+out:
5967 put_task_struct(task);
60
- return error;
68
+ return ERR_PTR(error);
6169 }
6270
6371 static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen)