Re: [PATCH] restore protections after forced fault in get_user_pages

From: Roland McGrath
Date: Mon Feb 02 2004 - 19:11:24 EST


> I'd suggest making this be:
> - handle_mm_fault() take a more detailed flag ("read / write / copy",
> where the new "copy" part is a write that actually leaves the page
> only readable, but marks it dirty)

On second thought, why is it necessary to have the caller tell
handle_mm_fault "write" vs "copy"? The existing "write" flag says do COW
and mark it dirty. Why not just redefine it not to also mean "make the pte
writable", but rather "make the pte as writable as the vma says"?
i.e., just replace pte_mkwrite(pte) with pte_modify(pte, vma->vm_page_prot)
throughout. That way we don't have to change all the arch/*/fault.c callers.

I think this question is orthogonal to my concern about follow_page.


Thanks,
Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/