aboutsummaryrefslogtreecommitdiffstats
path: root/mm/process_vm_access.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
commita2e5790d841658485d642196dbb0927303d6c22f (patch)
treeb3d28c9bcb7da6880806146fd22a88a7ee7f733e /mm/process_vm_access.c
parentab2d92ad881da11331280aedf612d82e61cb6d41 (diff)
parent60c3e026d73ccabb075fb70ba02f8512ab40cf2c (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - kasan updates - procfs - lib/bitmap updates - other lib/ updates - checkpatch tweaks - rapidio - ubsan - pipe fixes and cleanups - lots of other misc bits * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits) Documentation/sysctl/user.txt: fix typo MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns MAINTAINERS: update various PALM patterns MAINTAINERS: update "ARM/OXNAS platform support" patterns MAINTAINERS: update Cortina/Gemini patterns MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern MAINTAINERS: remove ANDROID ION pattern mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors mm: docs: fix parameter names mismatch mm: docs: fixup punctuation pipe: read buffer limits atomically pipe: simplify round_pipe_size() pipe: reject F_SETPIPE_SZ with size over UINT_MAX pipe: fix off-by-one error when checking buffer limits pipe: actually allow root to exceed the pipe buffer limits pipe, sysctl: remove pipe_proc_fn() pipe, sysctl: drop 'min' parameter from pipe-max-size converter kasan: rework Kconfig settings crash_dump: is_kdump_kernel can be boolean kernel/mutex: mutex_is_locked can be boolean ...
Diffstat (limited to 'mm/process_vm_access.c')
-rw-r--r--mm/process_vm_access.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
index 8973cd231ece..a447092d4635 100644
--- a/mm/process_vm_access.c
+++ b/mm/process_vm_access.c
@@ -25,7 +25,7 @@
25/** 25/**
26 * process_vm_rw_pages - read/write pages from task specified 26 * process_vm_rw_pages - read/write pages from task specified
27 * @pages: array of pointers to pages we want to copy 27 * @pages: array of pointers to pages we want to copy
28 * @start_offset: offset in page to start copying from/to 28 * @offset: offset in page to start copying from/to
29 * @len: number of bytes to copy 29 * @len: number of bytes to copy
30 * @iter: where to copy to/from locally 30 * @iter: where to copy to/from locally
31 * @vm_write: 0 means copy from, 1 means copy to 31 * @vm_write: 0 means copy from, 1 means copy to
@@ -147,6 +147,7 @@ static int process_vm_rw_single_vec(unsigned long addr,
147 * @riovcnt: size of rvec array 147 * @riovcnt: size of rvec array
148 * @flags: currently unused 148 * @flags: currently unused
149 * @vm_write: 0 if reading from other process, 1 if writing to other process 149 * @vm_write: 0 if reading from other process, 1 if writing to other process
150 *
150 * Returns the number of bytes read/written or error code. May 151 * Returns the number of bytes read/written or error code. May
151 * return less bytes than expected if an error occurs during the copying 152 * return less bytes than expected if an error occurs during the copying
152 * process. 153 * process.
@@ -197,11 +198,7 @@ static ssize_t process_vm_rw_core(pid_t pid, struct iov_iter *iter,
197 } 198 }
198 199
199 /* Get process information */ 200 /* Get process information */
200 rcu_read_lock(); 201 task = find_get_task_by_vpid(pid);
201 task = find_task_by_vpid(pid);
202 if (task)
203 get_task_struct(task);
204 rcu_read_unlock();
205 if (!task) { 202 if (!task) {
206 rc = -ESRCH; 203 rc = -ESRCH;
207 goto free_proc_pages; 204 goto free_proc_pages;
@@ -253,6 +250,7 @@ free_proc_pages:
253 * @riovcnt: size of rvec array 250 * @riovcnt: size of rvec array
254 * @flags: currently unused 251 * @flags: currently unused
255 * @vm_write: 0 if reading from other process, 1 if writing to other process 252 * @vm_write: 0 if reading from other process, 1 if writing to other process
253 *
256 * Returns the number of bytes read/written or error code. May 254 * Returns the number of bytes read/written or error code. May
257 * return less bytes than expected if an error occurs during the copying 255 * return less bytes than expected if an error occurs during the copying
258 * process. 256 * process.