[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090711081924.GA10437@elte.hu>
Date: Sat, 11 Jul 2009 10:19:24 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Sonny Rao <sonnyrao@...ibm.com>
Cc: tglx@...uxtronix.de, mingo@...hat.com,
linux-kernel@...r.kernel.org, linux-mm@...r.kernel.org,
stable@...nel.org, anton@...ba.org, rajamony@...ibm.com,
speight@...ibm.com, mstephen@...ibm.com, grimm@...ibm.com,
mikey@...abs.au.ibm.com
Subject: Re: [PATCH] futexs: fix infinite loop in get_futex_key on huge page
* Sonny Rao <sonnyrao@...ibm.com> wrote:
> get_futex_key() can infinitely loop if it is called on a virtual
> address that is within a huge page but not aligned to the
> beginning of that page. The call to get_user_pages_fast will
> return the struct page for a sub-page within the huge page and the
> check for page->mapping will always fail.
>
> The fix is to call compound_head on the page before checking that
> it's mapped.
>
> Signed-off-by: Sonny Rao <sonnyrao@...ibm.com>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: stable@...nel.org
>
> Index: linux-2.6.31-rc2/kernel/futex.c
> ===================================================================
> --- linux-2.6.31-rc2.orig/kernel/futex.c 2009-07-10 17:45:46.181084475 -0500
> +++ linux-2.6.31-rc2/kernel/futex.c 2009-07-10 17:46:47.345084062 -0500
> @@ -247,6 +247,7 @@
> if (err < 0)
> return err;
>
> + page = compound_head(page);
> lock_page(page);
> if (!page->mapping) {
> unlock_page(page);
Nice catch! Applied it to tip:core/urgent - Thomas, do you agree
with the fix?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists