Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30255
b: refs/heads/master
c: 5b0c1dd
h: refs/heads/master
i:
  30253: 39a4db7
  30251: bfe8c3e
  30247: 10a741f
  30239: 980766f
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Jun 26, 2006
1 parent 8ad9b92 commit 0d8b704
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 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: 13b41b09491e5d75e8027dca1ee78f5e073bc4c0
refs/heads/master: 5b0c1dd38b66e2dd0cf655aa845e341b50b93ddd
29 changes: 16 additions & 13 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,24 +1074,27 @@ static int proc_check_dentry_visible(struct inode *inode,
* namespace, or are simply process local (like pipes).
*/
struct task_struct *task;
struct files_struct *task_files, *files;
int error = -EACCES;

/* See if the the two tasks share a commone set of
* file descriptors. If so everything is visible.
*/
task = get_proc_task(inode);
if (!task)
goto out;
files = get_files_struct(current);
task_files = get_files_struct(task);
if (files && task_files && (files == task_files))
error = 0;
if (task_files)
put_files_struct(task_files);
if (files)
put_files_struct(files);
put_task_struct(task);
rcu_read_lock();
task = tref_task(proc_tref(inode));
if (task) {
struct files_struct *task_files, *files;
/* This test answeres the question:
* Is there a point in time since we looked up the
* file descriptor where the two tasks share the
* same files struct?
*/
rmb();
files = current->files;
task_files = task->files;
if (files && (files == task_files))
error = 0;
}
rcu_read_unlock();
if (!error)
goto out;

Expand Down

0 comments on commit 0d8b704

Please sign in to comment.