[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d00fc9d7-ea10-1577-40e9-03df1578acbe@huawei.com>
Date: Wed, 12 Jun 2019 09:50:25 +0800
From: "zhangxiaoxu (A)" <zhangxiaoxu5@...wei.com>
To: <tglx@...utronix.de>, <mingo@...hat.com>, <peterz@...radead.org>,
<dvhart@...radead.org>, <linux-kernel@...r.kernel.org>,
<stable@...r.kernel.org>
Subject: Re: [PATCH] futex: Fix futex lock the wrong page
This patch is for stable branch linux-4.4-y.
On 2019/6/12 9:54, ZhangXiaoxu wrote:
> 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 <zhangxiaoxu5@...wei.com>
> Cc: stable@...r.kernel.org
> ---
> kernel/futex.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/futex.c b/kernel/futex.c
> index ec9df5b..15d850f 100644
> --- 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);
>
>
Powered by blists - more mailing lists