From: Andrew Morton security_ptrace() is barfing when `current' == `task'. Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton --- fs/proc/base.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff -puN fs/proc/base.c~proc-use-sane-permission-checks-on-the-proc-pid-fd-fix fs/proc/base.c --- devel/fs/proc/base.c~proc-use-sane-permission-checks-on-the-proc-pid-fd-fix 2006-03-03 00:38:17.000000000 -0800 +++ devel-akpm/fs/proc/base.c 2006-03-03 00:43:54.000000000 -0800 @@ -521,8 +521,11 @@ static int proc_fd_access_allowed(struct * allow access if we have the proper capability. */ task = get_proc_task(inode); - if (task) { + if (task == current) + allowed = 1; + if (task && !allowed) { int alive; + task_lock(task); alive = !!task->mm; task_unlock(task); @@ -537,7 +540,6 @@ static int proc_fd_access_allowed(struct return allowed; } - extern struct seq_operations mounts_op; struct proc_mounts { struct seq_file m; _