[PATCH] ARM: Do not call flush_cache_user_range with mmap_sem held
olof at lixom.net
Wed Nov 16 19:20:15 EST 2011
On Wed, Nov 16, 2011 at 4:16 PM, Olof Johansson <olof at lixom.net> wrote:
> On Wed, Nov 16, 2011 at 3:50 PM, Russell King - ARM Linux
> <linux at arm.linux.org.uk> wrote:
>> On Wed, Nov 16, 2011 at 01:23:02PM -0800, Olof Johansson wrote:
>>> Agreed. Russell, please consider picking this up -- the bug is very
>>> real and it sounds like the objection is vague.
>> No, it isn't. It's creating an unsafe situation. If we're going to do
>> this, we might as well give up on architecture correctness because we're
>> throwing out locking correctness.
>> 1. We look up the VMA.
>> 2. We pass the VMA to the cache operation.
>> 3. The cache operation dereferences the VMA to obtain the VMA flags.
> The current implementation doesn't use the flush_cache_user_range
> per-cpu function, it uses the coherent_user_page:
> from arch/arm/include/asm/cacheflush.h:
> #define flush_cache_user_range(vma,start,end) \
> __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
> Which doesn't take flags. So the vma isn't used at all at the flushing
> step (which is also why this patch removes the flags being passed in).
I wonder if I am getting dyslexic.
s/the coherent_user_page/coherent_user_range/ above, and s/removes the
flags/removes the vma from/.
More information about the linux-arm-kernel