aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <[email protected]>2013-12-12 09:38:42 -0800
committerLinus Torvalds <[email protected]>2013-12-12 09:38:42 -0800
commitf12d5bfceb7e1f9051563381ec047f7f13956c3c (patch)
tree5b4eba241978619d763e5ba6209e111299a22bd3
parent9538e10086bd1301fe915683b1ba0a1de66d7483 (diff)
futex: fix handling of read-only-mapped hugepages
The hugepage code had the exact same bug that regular pages had in commit 7485d0d3758e ("futexes: Remove rw parameter from get_futex_key()"). The regular page case was fixed by commit 9ea71503a8ed ("futex: Fix regression with read only mappings"), but the transparent hugepage case (added in a5b338f2b0b1: "thp: update futex compound knowledge") case remained broken. Found by Dave Jones and his trinity tool. Reported-and-tested-by: Dave Jones <[email protected]> Cc: [email protected] # v2.6.38+ Acked-by: Thomas Gleixner <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Darren Hart <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--kernel/futex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 80ba086f021d..02febad00794 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -288,7 +288,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