Re: [PATCH 4/4] mm: check the device private page owner in hmm_range_fault

2020-03-21 Thread Jason Gunthorpe
On Sat, Mar 21, 2020 at 09:22:36AM +0100, Christoph Hellwig wrote: > On Fri, Mar 20, 2020 at 10:41:09AM -0300, Jason Gunthorpe wrote: > > Thinking about this some more, does the locking work out here? > > > > hmm_range_fault() runs with mmap_sem in read, and does not lock any of > > the page

Re: [PATCH 4/4] mm: check the device private page owner in hmm_range_fault

2020-03-21 Thread Jason Gunthorpe
On Mon, Mar 16, 2020 at 08:32:16PM +0100, Christoph Hellwig wrote: > diff --git a/mm/hmm.c b/mm/hmm.c > index cfad65f6a67b..b75b3750e03d 100644 > +++ b/mm/hmm.c > @@ -216,6 +216,14 @@ int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned > long addr, > unsigned long end, uint64_t

Re: [PATCH 4/4] mm: check the device private page owner in hmm_range_fault

2020-03-17 Thread Jason Gunthorpe
On Mon, Mar 16, 2020 at 08:32:16PM +0100, Christoph Hellwig wrote: > Hmm range fault will succeed for any kind of device private memory, > even if it doesn't belong to the calling entity. While nouveau > has some crude checks for that, they are broken because they assume > nouveau is the only

Re: [PATCH 4/4] mm: check the device private page owner in hmm_range_fault

2020-03-16 Thread Ralph Campbell
On 3/16/20 12:32 PM, Christoph Hellwig wrote: Hmm range fault will succeed for any kind of device private memory, even if it doesn't belong to the calling entity. While nouveau has some crude checks for that, they are broken because they assume nouveau is the only user of device private