Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 04:15:05PM +0100, Christian König wrote: > I have not the slightest idea how people got this impression, but I have > heard it so many time from so many different sources that there must be some > common cause to this. Is the maybe some book or tutorial how to sophisticate

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Daniel Vetter
On Wed, 23 Nov 2022 at 16:15, Christian König wrote: > > Am 23.11.22 um 16:08 schrieb Jason Gunthorpe: > > On Wed, Nov 23, 2022 at 03:34:54PM +0100, Daniel Vetter wrote: > >>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > >>> index 1376a47fedeedb..4161241fc3228c 100644 > >>> --- a/virt/

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Daniel Vetter
On Wed, 23 Nov 2022 at 16:04, Jason Gunthorpe wrote: > > On Wed, Nov 23, 2022 at 03:28:27PM +0100, Daniel Vetter wrote: > > > > This patch is known to be broken in so many ways. It also has a major > > > security hole that it ignores the PTE flags making the page > > > RO. Ignoring the special bit

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Christian König
Am 23.11.22 um 16:08 schrieb Jason Gunthorpe: On Wed, Nov 23, 2022 at 03:34:54PM +0100, Daniel Vetter wrote: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 1376a47fedeedb..4161241fc3228c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2598,6 +2598,19 @@ static int hv

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 03:34:54PM +0100, Daniel Vetter wrote: > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index 1376a47fedeedb..4161241fc3228c 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -2598,6 +2598,19 @@ static int hva_to_pfn_remapped(struct vm_a

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 03:28:27PM +0100, Daniel Vetter wrote: > > This patch is known to be broken in so many ways. It also has a major > > security hole that it ignores the PTE flags making the page > > RO. Ignoring the special bit is somehow not surprising :( > > > > This probably doesn't work,

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Daniel Vetter
On Wed, 23 Nov 2022 at 14:28, Jason Gunthorpe wrote: > > On Wed, Nov 23, 2022 at 02:12:25PM +0100, Christian König wrote: > > Am 23.11.22 um 13:53 schrieb Jason Gunthorpe: > > > On Wed, Nov 23, 2022 at 01:49:41PM +0100, Christian König wrote: > > > > Am 23.11.22 um 13:46 schrieb Jason Gunthorpe: >

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Daniel Vetter
On Wed, 23 Nov 2022 at 14:28, Jason Gunthorpe wrote: > > On Wed, Nov 23, 2022 at 02:12:25PM +0100, Christian König wrote: > > Am 23.11.22 um 13:53 schrieb Jason Gunthorpe: > > > On Wed, Nov 23, 2022 at 01:49:41PM +0100, Christian König wrote: > > > > Am 23.11.22 um 13:46 schrieb Jason Gunthorpe: >

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 02:12:25PM +0100, Christian König wrote: > Am 23.11.22 um 13:53 schrieb Jason Gunthorpe: > > On Wed, Nov 23, 2022 at 01:49:41PM +0100, Christian König wrote: > > > Am 23.11.22 um 13:46 schrieb Jason Gunthorpe: > > > > On Wed, Nov 23, 2022 at 11:06:55AM +0100, Daniel Vetter w

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Christian König
Am 23.11.22 um 13:53 schrieb Jason Gunthorpe: On Wed, Nov 23, 2022 at 01:49:41PM +0100, Christian König wrote: Am 23.11.22 um 13:46 schrieb Jason Gunthorpe: On Wed, Nov 23, 2022 at 11:06:55AM +0100, Daniel Vetter wrote: Maybe a GFP flag to set the page reference count to zero or something lik

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 01:49:41PM +0100, Christian König wrote: > Am 23.11.22 um 13:46 schrieb Jason Gunthorpe: > > On Wed, Nov 23, 2022 at 11:06:55AM +0100, Daniel Vetter wrote: > > > > > > Maybe a GFP flag to set the page reference count to zero or something > > > > like this? > > > Hm yeah tha

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Christian König
Am 23.11.22 um 13:46 schrieb Jason Gunthorpe: On Wed, Nov 23, 2022 at 11:06:55AM +0100, Daniel Vetter wrote: Maybe a GFP flag to set the page reference count to zero or something like this? Hm yeah that might work. I'm not sure what it will all break though? And we'd need to make sure that und

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2022 at 11:06:55AM +0100, Daniel Vetter wrote: > > Maybe a GFP flag to set the page reference count to zero or something > > like this? > > Hm yeah that might work. I'm not sure what it will all break though? > And we'd need to make sure that underflowing the page refcount dies in

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Daniel Vetter
On Wed, 23 Nov 2022 at 10:39, Christian König wrote: > > Am 23.11.22 um 10:30 schrieb Daniel Vetter: > > On Wed, 23 Nov 2022 at 10:06, Christian König > > wrote: > >> Am 22.11.22 um 20:50 schrieb Daniel Vetter: > >>> On Tue, 22 Nov 2022 at 20:34, Jason Gunthorpe wrote: > On Tue, Nov 22, 20

Re: [Linaro-mm-sig] Re: [PATCH] dma-buf: Require VM_PFNMAP vma for mmap

2022-11-23 Thread Christian König
Am 23.11.22 um 10:30 schrieb Daniel Vetter: On Wed, 23 Nov 2022 at 10:06, Christian König wrote: Am 22.11.22 um 20:50 schrieb Daniel Vetter: On Tue, 22 Nov 2022 at 20:34, Jason Gunthorpe wrote: On Tue, Nov 22, 2022 at 08:29:05PM +0100, Daniel Vetter wrote: You nuke all the ptes. Drivers tha