.. | .. |
---|
33 | 33 | #ifdef CONFIG_CGROUPS |
---|
34 | 34 | &cgroupns_operations, |
---|
35 | 35 | #endif |
---|
| 36 | +#ifdef CONFIG_TIME_NS |
---|
| 37 | + &timens_operations, |
---|
| 38 | + &timens_for_children_operations, |
---|
| 39 | +#endif |
---|
36 | 40 | }; |
---|
37 | 41 | |
---|
38 | 42 | static const char *proc_ns_get_link(struct dentry *dentry, |
---|
.. | .. |
---|
42 | 46 | const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops; |
---|
43 | 47 | struct task_struct *task; |
---|
44 | 48 | struct path ns_path; |
---|
45 | | - void *error = ERR_PTR(-EACCES); |
---|
| 49 | + int error = -EACCES; |
---|
46 | 50 | |
---|
47 | 51 | if (!dentry) |
---|
48 | 52 | return ERR_PTR(-ECHILD); |
---|
49 | 53 | |
---|
50 | 54 | task = get_proc_task(inode); |
---|
51 | 55 | if (!task) |
---|
52 | | - return error; |
---|
| 56 | + return ERR_PTR(-EACCES); |
---|
53 | 57 | |
---|
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: |
---|
59 | 67 | put_task_struct(task); |
---|
60 | | - return error; |
---|
| 68 | + return ERR_PTR(error); |
---|
61 | 69 | } |
---|
62 | 70 | |
---|
63 | 71 | static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen) |
---|