Cc: Linux Kernel Mailing List <linux-kernel@...>, Nick Piggin <npiggin@...>, Andrew Morton <akpm@...>, Rob Mueller <robm@...>, Andi Kleen <andi@...>, Ingo Molnar <mingo@...>
Heh. Congrats ;)
Is there any reason it doesn't use mmap(MAP_SHARED) and make the
modifications that way too?
Because quite frankly, the mixture of doing mmap() and write() system
calls is quite fragile - and I'm not saying that just because of this
particular bug, but because there are all kinds of nasty cache aliasing
issues with virtually indexed caches etc that just fundamentally mean that
it's often a mistake to mix mmap with read/write at the same time.
(For the same reason it's not a good idea to mix writing through an mmap()
and then using read() to read it - again, you can have some nasty aliasing
going on there).
So this particular issue was definitely a kernel bug (and big thanks for
making such a good test-case), but in general, it does sound like Cyrus is
actively trying to dig itself into a nasty hole there.
Linus
--