tux3: Support mmap write: Fix race of mmap write with write(2) on delta boundary
Clear writable to protect oldpage from following mmap write race.
cpu0 cpu1 cpu2
[backend] dirty old
no page fault
copy_page(new, old) modify page
There is delay between delta++ and page_mkclean() for I/O. So,
while cpu0 copying data on page by pagefork, another cpu (cpu2)
can change data on the same page. If this race happens, new and old
page can have different data.
To fix this race, we should make PTE read-only before start pagefork
at [*A] place.
Signed-off-by: OGAWA Hirofumi <email@example.com>
1 file changed