This is a note to let you know that I've just added the patch titled

    ARM: 7409/1: Do not call flush_cache_user_range with mmap_sem held

to the 3.0-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm-7409-1-do-not-call-flush_cache_user_range-with-mmap_sem-held.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 435a7ef52db7d86e67a009b36cac1457f8972391 Mon Sep 17 00:00:00 2001
From: Dima Zavin <[email protected]>
Date: Mon, 30 Apr 2012 10:26:14 +0100
Subject: ARM: 7409/1: Do not call flush_cache_user_range with mmap_sem held

From: Dima Zavin <[email protected]>

commit 435a7ef52db7d86e67a009b36cac1457f8972391 upstream.

We can't be holding the mmap_sem while calling flush_cache_user_range
because the flush can fault. If we fault on a user address, the
page fault handler will try to take mmap_sem again. Since both places
acquire the read lock, most of the time it succeeds. However, if another
thread tries to acquire the write lock on the mmap_sem (e.g. mmap) in
between the call to flush_cache_user_range and the fault, the down_read
in do_page_fault will deadlock.

[will: removed drop of vma parameter as already queued by rmk (7365/1)]

Acked-by: Catalin Marinas <[email protected]>
Signed-off-by: Dima Zavin <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 arch/arm/kernel/traps.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -451,7 +451,9 @@ do_cache_op(unsigned long start, unsigne
                if (end > vma->vm_end)
                        end = vma->vm_end;
 
+               up_read(&mm->mmap_sem);
                flush_cache_user_range(start, end);
+               return;
        }
        up_read(&mm->mmap_sem);
 }


Patches currently in stable-queue which might be from [email protected] are

queue-3.0/arm-7409-1-do-not-call-flush_cache_user_range-with-mmap_sem-held.patch
queue-3.0/arm-7365-1-drop-unused-parameter-from-flush_cache_user_range.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to