[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091217011559.279090025@mini.kroah.org>
Date: Wed, 16 Dec 2009 17:14:22 -0800
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Andi Kleen <ak@...ux.intel.com>,
Andrew Morton <akpm@...uxfoundation.org>,
Nick Piggin <npiggin@...e.de>, Darren Hart <dvhltc@...ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: [11/90] futex: Take mmap_sem for get_user_pages in fault_in_user_writeable
2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andi Kleen <andi@...stfloor.org>
commit 722d0172377a5697919b9f7e5beb95165b1dec4e upstream.
get_user_pages() must be called with mmap_sem held.
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
Cc: Andrew Morton <akpm@...uxfoundation.org>
Cc: Nick Piggin <npiggin@...e.de>
Cc: Darren Hart <dvhltc@...ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
LKML-Reference: <20091208121942.GA21298@...il.fritz.box>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
kernel/futex.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -303,8 +303,14 @@ void put_futex_key(int fshared, union fu
*/
static int fault_in_user_writeable(u32 __user *uaddr)
{
- int ret = get_user_pages(current, current->mm, (unsigned long)uaddr,
- 1, 1, 0, NULL, NULL);
+ struct mm_struct *mm = current->mm;
+ int ret;
+
+ down_read(&mm->mmap_sem);
+ ret = get_user_pages(current, mm, (unsigned long)uaddr,
+ 1, 1, 0, NULL, NULL);
+ up_read(&mm->mmap_sem);
+
return ret < 0 ? ret : 0;
}
--
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