Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30241
b: refs/heads/master
c: 6860206
h: refs/heads/master
i:
  30239: 980766f
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Jun 26, 2006
1 parent e8cdc46 commit 5acecfe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 64 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aed7a6c476d90660ac5af860158407ae9fe61c68
refs/heads/master: 68602066c3327fa340899609d715781eda423751
63 changes: 0 additions & 63 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,54 +361,6 @@ static int proc_root_link(struct inode *inode, struct dentry **dentry, struct vf
return result;
}


/* Same as proc_root_link, but this addionally tries to get fs from other
* threads in the group */
static int proc_task_root_link(struct inode *inode, struct dentry **dentry,
struct vfsmount **mnt)
{
struct fs_struct *fs;
int result = -ENOENT;
struct task_struct *leader = proc_task(inode);

task_lock(leader);
fs = leader->fs;
if (fs) {
atomic_inc(&fs->count);
task_unlock(leader);
} else {
/* Try to get fs from other threads */
task_unlock(leader);
read_lock(&tasklist_lock);
if (pid_alive(leader)) {
struct task_struct *task = leader;

while ((task = next_thread(task)) != leader) {
task_lock(task);
fs = task->fs;
if (fs) {
atomic_inc(&fs->count);
task_unlock(task);
break;
}
task_unlock(task);
}
}
read_unlock(&tasklist_lock);
}

if (fs) {
read_lock(&fs->lock);
*mnt = mntget(fs->rootmnt);
*dentry = dget(fs->root);
read_unlock(&fs->lock);
result = 0;
put_fs_struct(fs);
}
return result;
}


#define MAY_PTRACE(task) \
(task == current || \
(task->parent == current && \
Expand Down Expand Up @@ -600,20 +552,6 @@ static int proc_permission(struct inode *inode, int mask, struct nameidata *nd)
return proc_check_root(inode);
}

static int proc_task_permission(struct inode *inode, int mask, struct nameidata *nd)
{
struct dentry *root;
struct vfsmount *vfsmnt;

if (generic_permission(inode, mask, NULL) != 0)
return -EACCES;

if (proc_task_root_link(inode, &root, &vfsmnt))
return -ENOENT;

return proc_check_chroot(root, vfsmnt);
}

extern struct seq_operations proc_pid_maps_op;
static int maps_open(struct inode *inode, struct file *file)
{
Expand Down Expand Up @@ -1583,7 +1521,6 @@ static struct inode_operations proc_fd_inode_operations = {

static struct inode_operations proc_task_inode_operations = {
.lookup = proc_task_lookup,
.permission = proc_task_permission,
};

#ifdef CONFIG_SECURITY
Expand Down

0 comments on commit 5acecfe

Please sign in to comment.