[PATCH v2 23/34] uprobes: convert put_page() to put_user_page*()

john.hubbard
2019-08-04T22:52:42Z

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
kernel/events/uprobes.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 84fa00497c49..4a575de8cec8 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -397,7 +397,7 @@ __update_ref_ctr(struct mm_struct *mm, unsigned long vaddr, short d)
ret = 0;
out:
kunmap_atomic(kaddr);
- put_page(page);
+ put_user_page(page);
return ret;
}

@@ -504,7 +504,7 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
ret = __replace_page(vma, vaddr, old_page, new_page);
put_page(new_page);
put_old:
- put_page(old_page);
+ put_user_page(old_page);

if (unlikely(ret == -EAGAIN))
goto retry;
@@ -1981,7 +1981,7 @@ static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
return result;

copy_from_page(page, vaddr, &opcode, UPROBE_SWBP_INSN_SIZE);
- put_page(page);
+ put_user_page(page);
out:
/* This needs to return true for any variant of the trap insn */
return is_trap_insn(&opcode);
--
2.22.0