From d3b077bc15b47ecd3d8b66b7bd87817daf2d5135 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Thu, 18 Mar 2021 13:30:17 -0700 Subject: [PATCH] ANDROID: mm: page_pinner: use put_user_page at copy_string copy_string calls __get_user_pages by copy_strings. Thus, let's use put_user_page to close the false positive. Page pinned via pid 905, ts 13725666111 ns PFN 104188 Block 203 type Movable Flags 0xfffffc0080036(referenced|uptodate|lru|active|swapbacked) try_grab_page+0x144/0x160 follow_page_mask+0x4a1/0x630 __get_user_pages+0x24e/0x760 __get_user_pages_remote+0xd4/0x320 get_arg_page+0x3e/0xa0 copy_strings.isra.0+0x201/0x380 do_execveat_common+0x17a/0x1c0 __x64_sys_execve+0x39/0x50 do_syscall_64+0x33/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Bug: 183414571 Signed-off-by: Minchan Kim Change-Id: I4c515d12f75496741cd80a24cf6ea971006f0bce --- fs/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exec.c b/fs/exec.c index ca89e0e3ef10..cc08a3bd566d 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -232,7 +232,7 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, static void put_arg_page(struct page *page) { - put_page(page); + put_user_page(page); } static void free_arg_pages(struct linux_binprm *bprm)