mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "zhangxiaoxu (A)" <zhangxiaoxu5@huawei.com>
To: <tglx@linutronix.de>, <mingo@redhat.com>, <peterz@infradead.org>,
	<dvhart@infradead.org>, <linux-kernel@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH] futex: Fix futex lock the wrong page
Date: Wed, 12 Jun 2019 09:50:25 +0800	[thread overview]
Message-ID: <d00fc9d7-ea10-1577-40e9-03df1578acbe@huawei.com> (raw)
In-Reply-To: <1560304465-68966-1-git-send-email-zhangxiaoxu5@huawei.com>

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@huawei.com>
> Cc: stable@vger.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);
>   
> 


  reply	other threads:[~2019-06-12  1:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12  1:54 ZhangXiaoxu
2019-06-12  1:50 ` zhangxiaoxu (A) [this message]
2019-06-12  7:15   ` Greg KH
2019-06-12  7:29     ` Thomas Gleixner
2019-06-12 11:01       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d00fc9d7-ea10-1577-40e9-03df1578acbe@huawei.com \
    --to=zhangxiaoxu5@huawei.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®