Re: [PATCH v5 08/14] mm/gup: do not allow zero page for pinned pages

From: Jason Gunthorpe
Date: Tue Jan 19 2021 - 18:43:44 EST


On Tue, Jan 19, 2021 at 03:14:04PM -0500, Pavel Tatashin wrote:

> I was thinking about a use case where userland would pin an address
> without FOLL_WRITE, because the PTE for that address is not going to
> be writable, but some device via DMA will write to it.

That would be a serious bug in the get_user_pages caller to write to a
page without using FOLL_WRITE

Jason