diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-08 12:10:13 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-08 12:10:13 -0400 |
commit | da821eb7d42935b0f7056d98c75fd1150f6636f4 (patch) | |
tree | de83ac171d51bbe7621110c3145a68c198b13711 /fs/proc | |
parent | 296f3f2c9322480400338f71d8c118107f9a7f20 (diff) | |
parent | 07961ac7c0ee8b546658717034fe692fd12eefa9 (diff) |
Merge commit 'v3.9-rc5' into next/clk-exynos
Conflicts:
arch/arm/boot/dts/exynos4.dtsi
arch/arm/boot/dts/exynos5440.dtsi
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/inode.c | 6 | ||||
-rw-r--r-- | fs/proc/namespaces.c | 12 | ||||
-rw-r--r-- | fs/proc/root.c | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index a86aebc9ba7c..869116c2afbe 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -446,9 +446,10 @@ static const struct file_operations proc_reg_file_ops_no_compat = { | |||
446 | 446 | ||
447 | struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) | 447 | struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) |
448 | { | 448 | { |
449 | struct inode *inode = iget_locked(sb, de->low_ino); | 449 | struct inode *inode = new_inode_pseudo(sb); |
450 | 450 | ||
451 | if (inode && (inode->i_state & I_NEW)) { | 451 | if (inode) { |
452 | inode->i_ino = de->low_ino; | ||
452 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 453 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
453 | PROC_I(inode)->pde = de; | 454 | PROC_I(inode)->pde = de; |
454 | 455 | ||
@@ -476,7 +477,6 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) | |||
476 | inode->i_fop = de->proc_fops; | 477 | inode->i_fop = de->proc_fops; |
477 | } | 478 | } |
478 | } | 479 | } |
479 | unlock_new_inode(inode); | ||
480 | } else | 480 | } else |
481 | pde_put(de); | 481 | pde_put(de); |
482 | return inode; | 482 | return inode; |
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index b7a47196c8c3..66b51c0383da 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c | |||
@@ -118,7 +118,7 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
118 | struct super_block *sb = inode->i_sb; | 118 | struct super_block *sb = inode->i_sb; |
119 | struct proc_inode *ei = PROC_I(inode); | 119 | struct proc_inode *ei = PROC_I(inode); |
120 | struct task_struct *task; | 120 | struct task_struct *task; |
121 | struct dentry *ns_dentry; | 121 | struct path ns_path; |
122 | void *error = ERR_PTR(-EACCES); | 122 | void *error = ERR_PTR(-EACCES); |
123 | 123 | ||
124 | task = get_proc_task(inode); | 124 | task = get_proc_task(inode); |
@@ -128,14 +128,14 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
128 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) | 128 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
129 | goto out_put_task; | 129 | goto out_put_task; |
130 | 130 | ||
131 | ns_dentry = proc_ns_get_dentry(sb, task, ei->ns_ops); | 131 | ns_path.dentry = proc_ns_get_dentry(sb, task, ei->ns_ops); |
132 | if (IS_ERR(ns_dentry)) { | 132 | if (IS_ERR(ns_path.dentry)) { |
133 | error = ERR_CAST(ns_dentry); | 133 | error = ERR_CAST(ns_path.dentry); |
134 | goto out_put_task; | 134 | goto out_put_task; |
135 | } | 135 | } |
136 | 136 | ||
137 | dput(nd->path.dentry); | 137 | ns_path.mnt = mntget(nd->path.mnt); |
138 | nd->path.dentry = ns_dentry; | 138 | nd_jump_link(nd, &ns_path); |
139 | error = NULL; | 139 | error = NULL; |
140 | 140 | ||
141 | out_put_task: | 141 | out_put_task: |
diff --git a/fs/proc/root.c b/fs/proc/root.c index c6e9fac26bac..9c7fab1d23f0 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/bitops.h> | 18 | #include <linux/bitops.h> |
19 | #include <linux/user_namespace.h> | ||
19 | #include <linux/mount.h> | 20 | #include <linux/mount.h> |
20 | #include <linux/pid_namespace.h> | 21 | #include <linux/pid_namespace.h> |
21 | #include <linux/parser.h> | 22 | #include <linux/parser.h> |
@@ -108,6 +109,9 @@ static struct dentry *proc_mount(struct file_system_type *fs_type, | |||
108 | } else { | 109 | } else { |
109 | ns = task_active_pid_ns(current); | 110 | ns = task_active_pid_ns(current); |
110 | options = data; | 111 | options = data; |
112 | |||
113 | if (!current_user_ns()->may_mount_proc) | ||
114 | return ERR_PTR(-EPERM); | ||
111 | } | 115 | } |
112 | 116 | ||
113 | sb = sget(fs_type, proc_test_super, proc_set_super, flags, ns); | 117 | sb = sget(fs_type, proc_test_super, proc_set_super, flags, ns); |