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

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


> That should be sufficient, I think: since "handle_mm_fault()" marks the
> page dirty (but not writable) and will have done all the work to do a COW,
> we know that once we do the "follow_page()", we'll be getting a private
> copy. Which is what we wanted.

The only potential hole I can see here is if there is an (exceedingly rare)
race where the page could be ejected after handle_mm_fault, then brought
back in but not marked dirty, before follow_page looks it up and returns a
page to be used for writing without marking it dirty. Obviously this is a
ridiculously unlikely case. But what I don't know is whether it is
strictly speaking impossible. That is, that a page once dirty then later
not present, would ever again be present without also being dirty.


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/