diff options
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/uprobes.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 1d9c0a985960..98256bc71ee1 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -141,10 +141,14 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, | |||
141 | spinlock_t *ptl; | 141 | spinlock_t *ptl; |
142 | pte_t *ptep; | 142 | pte_t *ptep; |
143 | int err; | 143 | int err; |
144 | /* For mmu_notifiers */ | ||
145 | const unsigned long mmun_start = addr; | ||
146 | const unsigned long mmun_end = addr + PAGE_SIZE; | ||
144 | 147 | ||
145 | /* For try_to_free_swap() and munlock_vma_page() below */ | 148 | /* For try_to_free_swap() and munlock_vma_page() below */ |
146 | lock_page(page); | 149 | lock_page(page); |
147 | 150 | ||
151 | mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end); | ||
148 | err = -EAGAIN; | 152 | err = -EAGAIN; |
149 | ptep = page_check_address(page, mm, addr, &ptl, 0); | 153 | ptep = page_check_address(page, mm, addr, &ptl, 0); |
150 | if (!ptep) | 154 | if (!ptep) |
@@ -173,6 +177,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, | |||
173 | 177 | ||
174 | err = 0; | 178 | err = 0; |
175 | unlock: | 179 | unlock: |
180 | mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); | ||
176 | unlock_page(page); | 181 | unlock_page(page); |
177 | return err; | 182 | return err; |
178 | } | 183 | } |