aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 01:49:58 -0500
committerNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:29 -0500
commitb74c79e99389cd79b31fcc08f82c24e492e63c7e (patch)
tree763c6b412517306670bc625e90035f2d16bb739f /fs/proc/base.c
parent34286d6662308d82aed891852d04c7c3a2649b16 (diff)
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index dc5b2fcadc3b..b953d41d9abf 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2114,11 +2114,13 @@ static const struct file_operations proc_fd_operations = {
2114 * /proc/pid/fd needs a special permission handler so that a process can still 2114 * /proc/pid/fd needs a special permission handler so that a process can still
2115 * access /proc/self/fd after it has executed a setuid(). 2115 * access /proc/self/fd after it has executed a setuid().
2116 */ 2116 */
2117static int proc_fd_permission(struct inode *inode, int mask) 2117static int proc_fd_permission(struct inode *inode, int mask, unsigned int flags)
2118{ 2118{
2119 int rv; 2119 int rv;
2120 2120
2121 rv = generic_permission(inode, mask, NULL); 2121 if (flags & IPERM_FLAG_RCU)
2122 return -ECHILD;
2123 rv = generic_permission(inode, mask, flags, NULL);
2122 if (rv == 0) 2124 if (rv == 0)
2123 return 0; 2125 return 0;
2124 if (task_pid(current) == proc_pid(inode)) 2126 if (task_pid(current) == proc_pid(inode))