[PATCH] ARM: Do not call flush_cache_user_range with mmap_sem held
Russell King - ARM Linux
linux at arm.linux.org.uk
Thu Nov 17 05:45:46 EST 2011
On Wed, Nov 16, 2011 at 04:16:17PM -0800, Olof Johansson wrote:
> Yep, I would agree if we actually needed the vma for the flags, but we
> don't with the current implementation.
That's just one reason. I mentioned more than one reason why the locking
was necessary in my mail but you seem to have ignored that. The second
reason is a far more serious problem.
> We also don't continue iterating over the vmas, we only flush for the
> first one in the range that we find. That is possibly a bug.
No, that's intentional. This function is not supposed to be used to
invalidate across several mappings. It's there to deal with JIT code,
which will be written into some allocated memory. It is extremely
unlikely that JIT code will be written into two consecutive, independently
created mappings and a single cache operation requested over both.
What if the two independent mappings are located at wildly different
addresses?
More information about the linux-arm-kernel
mailing list