diff options
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/uprobes.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index bb30a4fc5050..c08a22d02f72 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/swap.h> /* try_to_free_swap */ | 32 | #include <linux/swap.h> /* try_to_free_swap */ |
33 | #include <linux/ptrace.h> /* user_enable_single_step */ | 33 | #include <linux/ptrace.h> /* user_enable_single_step */ |
34 | #include <linux/kdebug.h> /* notifier mechanism */ | 34 | #include <linux/kdebug.h> /* notifier mechanism */ |
35 | #include "../../mm/internal.h" /* munlock_vma_page */ | ||
35 | 36 | ||
36 | #include <linux/uprobes.h> | 37 | #include <linux/uprobes.h> |
37 | 38 | ||
@@ -141,7 +142,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, | |||
141 | pte_t *ptep; | 142 | pte_t *ptep; |
142 | int err; | 143 | int err; |
143 | 144 | ||
144 | /* freeze PageSwapCache() for try_to_free_swap() below */ | 145 | /* For try_to_free_swap() and munlock_vma_page() below */ |
145 | lock_page(page); | 146 | lock_page(page); |
146 | 147 | ||
147 | err = -EAGAIN; | 148 | err = -EAGAIN; |
@@ -164,9 +165,12 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, | |||
164 | page_remove_rmap(page); | 165 | page_remove_rmap(page); |
165 | if (!page_mapped(page)) | 166 | if (!page_mapped(page)) |
166 | try_to_free_swap(page); | 167 | try_to_free_swap(page); |
167 | put_page(page); | ||
168 | pte_unmap_unlock(ptep, ptl); | 168 | pte_unmap_unlock(ptep, ptl); |
169 | 169 | ||
170 | if (vma->vm_flags & VM_LOCKED) | ||
171 | munlock_vma_page(page); | ||
172 | put_page(page); | ||
173 | |||
170 | err = 0; | 174 | err = 0; |
171 | unlock: | 175 | unlock: |
172 | unlock_page(page); | 176 | unlock_page(page); |