diff options
author | Colin Cross <ccross@android.com> | 2011-08-10 18:07:59 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-08-10 18:07:59 -0700 |
commit | 9abd59b0df155835a970c2b9c8f93367eb793797 (patch) | |
tree | bcf0868f831d204e2b582113c53b8de3ff015eca /fs/proc | |
parent | 4e111751cfcb75f26d2725eab934b6eb91a3d115 (diff) | |
parent | 94ed5b4788a7cdbe68bc7cb8516972cbebdc8274 (diff) | |
download | kernel_samsung_aries-9abd59b0df155835a970c2b9c8f93367eb793797.zip kernel_samsung_aries-9abd59b0df155835a970c2b9c8f93367eb793797.tar.gz kernel_samsung_aries-9abd59b0df155835a970c2b9c8f93367eb793797.tar.bz2 |
Merge commit 'v3.0.1' into android-3.0
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index cc9c0c3..efb3048 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2747,9 +2747,16 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) { struct task_io_accounting acct = task->ioac; unsigned long flags; + int result; - if (!ptrace_may_access(task, PTRACE_MODE_READ)) - return -EACCES; + result = mutex_lock_killable(&task->signal->cred_guard_mutex); + if (result) + return result; + + if (!ptrace_may_access(task, PTRACE_MODE_READ)) { + result = -EACCES; + goto out_unlock; + } if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2760,7 +2767,7 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) unlock_task_sighand(task, &flags); } - return sprintf(buffer, + result = sprintf(buffer, "rchar: %llu\n" "wchar: %llu\n" "syscr: %llu\n" @@ -2775,6 +2782,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) (unsigned long long)acct.read_bytes, (unsigned long long)acct.write_bytes, (unsigned long long)acct.cancelled_write_bytes); +out_unlock: + mutex_unlock(&task->signal->cred_guard_mutex); + return result; } static int proc_tid_io_accounting(struct task_struct *task, char *buffer) |