diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index c3af15e9c070..daba13653256 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -775,7 +775,8 @@ static ssize_t mem_read(struct file * file, char __user * buf, | |||
775 | if (!task) | 775 | if (!task) |
776 | goto out_no_task; | 776 | goto out_no_task; |
777 | 777 | ||
778 | if (check_mem_permission(task)) | 778 | ret = check_mem_permission(task); |
779 | if (ret) | ||
779 | goto out; | 780 | goto out; |
780 | 781 | ||
781 | ret = -ENOMEM; | 782 | ret = -ENOMEM; |
@@ -845,7 +846,8 @@ static ssize_t mem_write(struct file * file, const char __user *buf, | |||
845 | if (!task) | 846 | if (!task) |
846 | goto out_no_task; | 847 | goto out_no_task; |
847 | 848 | ||
848 | if (check_mem_permission(task)) | 849 | copied = check_mem_permission(task); |
850 | if (copied) | ||
849 | goto out; | 851 | goto out; |
850 | 852 | ||
851 | copied = -ENOMEM; | 853 | copied = -ENOMEM; |
@@ -917,6 +919,7 @@ static ssize_t environ_read(struct file *file, char __user *buf, | |||
917 | if (!task) | 919 | if (!task) |
918 | goto out_no_task; | 920 | goto out_no_task; |
919 | 921 | ||
922 | ret = -EPERM; | ||
920 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) | 923 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
921 | goto out; | 924 | goto out; |
922 | 925 | ||