futex: fix handling of read-only-mapped hugepages
commitf12d5bfcebupstream. The hugepage code had the exact same bug that regular pages had in commit7485d0d375("futexes: Remove rw parameter from get_futex_key()"). The regular page case was fixed by commit9ea71503a8("futex: Fix regression with read only mappings"), but the transparent hugepage case (added ina5b338f2b0: "thp: update futex compound knowledge") case remained broken. Found by Dave Jones and his trinity tool. Reported-and-tested-by: Dave Jones <davej@fedoraproject.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Mel Gorman <mgorman@suse.de> Cc: Darren Hart <dvhart@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2a038881b6
commit
13bb709cbe
1 changed files with 1 additions and 1 deletions
|
|
@ -287,7 +287,7 @@ again:
|
|||
put_page(page);
|
||||
/* serialize against __split_huge_page_splitting() */
|
||||
local_irq_disable();
|
||||
if (likely(__get_user_pages_fast(address, 1, 1, &page) == 1)) {
|
||||
if (likely(__get_user_pages_fast(address, 1, !ro, &page) == 1)) {
|
||||
page_head = compound_head(page);
|
||||
/*
|
||||
* page_head is valid pointer but we must pin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue