ANDROID: mm: page_pinner: use put_user_page at get_futex_key

get_futex_key uses get_user_pages_fast so close the false positive
by using pin_user_page.

Page pinned via pid 686, ts 20096178239 ns
PFN 86760 Block 169 type Movable Flags 0xfffffc0080016(referenced|uptodate|lru|swapbacked)
 try_grab_compound_head+0x1e8/0x240
 internal_get_user_pages_fast+0x66d/0xca0
 get_futex_key+0x8e/0x440
 futex_wake+0x67/0x180
 do_futex+0x7c5/0xb20
 mm_release+0xb6/0xc0
 do_exit+0x1dc/0xa40
 __x64_sys_exit+0x17/0x20
 do_syscall_64+0x33/0x80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Bug: 183414571
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: I217b2712782eb571e68191d201e3781f57caf4d9
This commit is contained in:
Minchan Kim
2021-03-18 13:34:52 -07:00
committed by Minchan Kim
parent d3b077bc15
commit f8d9ffe242

View File

@@ -588,7 +588,7 @@ again:
lock_page(page);
shmem_swizzled = PageSwapCache(page) || page->mapping;
unlock_page(page);
put_page(page);
put_user_page(page);
if (shmem_swizzled)
goto again;
@@ -638,7 +638,7 @@ again:
if (READ_ONCE(page->mapping) != mapping) {
rcu_read_unlock();
put_page(page);
put_user_page(page);
goto again;
}
@@ -646,7 +646,7 @@ again:
inode = READ_ONCE(mapping->host);
if (!inode) {
rcu_read_unlock();
put_page(page);
put_user_page(page);
goto again;
}
@@ -658,7 +658,7 @@ again:
}
out:
put_page(page);
put_user_page(page);
return err;
}