From 1479f22eb78c499f2c1f033ae0ee56f67d2f8aa4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 12 Jun 2019 13:14:54 +0200 Subject: [PATCH] 4.4-stable patches added patches: futex-fix-futex-lock-the-wrong-page.patch --- .../futex-fix-futex-lock-the-wrong-page.patch | 41 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 queue-4.4/futex-fix-futex-lock-the-wrong-page.patch diff --git a/queue-4.4/futex-fix-futex-lock-the-wrong-page.patch b/queue-4.4/futex-fix-futex-lock-the-wrong-page.patch new file mode 100644 index 0000000000..83fc01d661 --- /dev/null +++ b/queue-4.4/futex-fix-futex-lock-the-wrong-page.patch @@ -0,0 +1,41 @@ +From zhangxiaoxu5@huawei.com Wed Jun 12 13:03:33 2019 +From: ZhangXiaoxu +Date: Wed, 12 Jun 2019 09:54:25 +0800 +Subject: futex: Fix futex lock the wrong page +To: , , , , , +Message-ID: <1560304465-68966-1-git-send-email-zhangxiaoxu5@huawei.com> + +From: ZhangXiaoxu + +The upstram commit 65d8fc777f6d ("futex: Remove requirement +for lock_page() in get_futex_key()") use variable 'page' as +the page head, when merge it to stable branch, the variable +`page_head` is page head. + +In the stable branch, the variable `page` not means the page +head, when lock the page head, we should lock 'page_head', +rather than 'page'. + +It maybe lead a hung task problem. + +Signed-off-by: ZhangXiaoxu +Cc: stable@vger.kernel.org +Cc: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman +--- + kernel/futex.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -593,8 +593,8 @@ again: + * applies. If this is really a shmem page then the page lock + * will prevent unexpected transitions. + */ +- lock_page(page); +- shmem_swizzled = PageSwapCache(page) || page->mapping; ++ lock_page(page_head); ++ shmem_swizzled = PageSwapCache(page_head) || page_head->mapping; + unlock_page(page_head); + put_page(page_head); + diff --git a/queue-4.4/series b/queue-4.4/series index 5ba3dd8d01..a6aa39aeca 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -38,3 +38,4 @@ pwm-tiehrpwm-update-shadow-register-for-disabling-pw.patch arm-dts-exynos-always-enable-necessary-apio_1v8-and-.patch pwm-fix-deadlock-warning-when-removing-pwm-device.patch arm-exynos-fix-undefined-instruction-during-exynos54.patch +futex-fix-futex-lock-the-wrong-page.patch -- 2.39.2