]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
uprobes: is_trap_at_addr: don't use get_user_pages_remote()
authorOleg Nesterov <oleg@redhat.com>
Thu, 1 Aug 2024 13:27:14 +0000 (15:27 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 2 Aug 2024 09:30:30 +0000 (11:30 +0200)
get_user_pages_remote() and the comment above it make no sense.

There is no task_struct passed into get_user_pages_remote() anymore, and
nowadays mm_account_fault() increments the current->min/maj_flt counters
regardless of FAULT_FLAG_REMOTE.

Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240801132714.GA8783@redhat.com
kernel/events/uprobes.c

index 2d1457eee965779cee066bddd20f0145da7d8bee..698bb22f7102c672b85205cbfcabb0e8f0a2cd7e 100644 (file)
@@ -2035,13 +2035,7 @@ static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
        if (likely(result == 0))
                goto out;
 
-       /*
-        * The NULL 'tsk' here ensures that any faults that occur here
-        * will not be accounted to the task.  'mm' *is* current->mm,
-        * but we treat this as a 'remote' access since it is
-        * essentially a kernel access to the memory.
-        */
-       result = get_user_pages_remote(mm, vaddr, 1, FOLL_FORCE, &page, NULL);
+       result = get_user_pages(vaddr, 1, FOLL_FORCE, &page);
        if (result < 0)
                return result;