summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c4
-rw-r--r--mm/nommu.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c
index ad4bf1a1a0ef..53bd59579861 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4344,7 +4344,9 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
4344 void *old_buf = buf; 4344 void *old_buf = buf;
4345 int write = gup_flags & FOLL_WRITE; 4345 int write = gup_flags & FOLL_WRITE;
4346 4346
4347 down_read(&mm->mmap_sem); 4347 if (down_read_killable(&mm->mmap_sem))
4348 return 0;
4349
4348 /* ignore errors, just check how much was successfully transferred */ 4350 /* ignore errors, just check how much was successfully transferred */
4349 while (len) { 4351 while (len) {
4350 int bytes, ret, offset; 4352 int bytes, ret, offset;
diff --git a/mm/nommu.c b/mm/nommu.c
index 07165ad2e548..eb3e2e558da1 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1704,7 +1704,8 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
1704 struct vm_area_struct *vma; 1704 struct vm_area_struct *vma;
1705 int write = gup_flags & FOLL_WRITE; 1705 int write = gup_flags & FOLL_WRITE;
1706 1706
1707 down_read(&mm->mmap_sem); 1707 if (down_read_killable(&mm->mmap_sem))
1708 return 0;
1708 1709
1709 /* the access must start within one of the target process's mappings */ 1710 /* the access must start within one of the target process's mappings */
1710 vma = find_vma(mm, addr); 1711 vma = find_vma(mm, addr);