Re: [patch 2/6] mm: fix vma_is_anonymous() false-positives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 22, 2018 at 01:21:06PM -0700, Linus Torvalds wrote:
> On Sat, Jul 21, 2018 at 3:49 PM Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > IOW, Kirill's patch now just boils down to the attached trial patch.
> 
> Side note: we have a few rdma drivers that mess with vm_ops.
> 
> One does so intentionally, see mlx4_ib_vma_open() in
> 
>     drivers/infiniband/hw/mlx4/main.c
> 
> and one *may* be intentional but it's not entirely clear:
> hns_roce_vma_open() may bve the same issue, but
> hns_roce_disassociate_ucontext() just looks pointless in
> 
>     drivers/infiniband/hw/hns/hns_roce_main.c
> 
> Afaik, they should just use  VM_DONTCOPY to not see the fork open
> case, VM_DONTEXPAND to fail a size-changing mremap, and set a
> vm_ops->split() function that returns an error.
> 
> Maybe we should have a VM_DONTSPLIT to make that ->split() case be simpler.
> 
> Their vma->vm_ops games seem very bogus, and will cause oddities. So
> right now they *will* get copied on fork and split, and then you have
> random crazy pages being mapped but not the right vm_ops. In addition
> to the confusion with vma_is_anonymous().

We've now got patches in rdma.git's for-next (and linux-next) that
conslidates this driver code and eliminates the vm_ops games in all
the infiniband drivers. 

Hopefully this helps whatever this vma_is_anonymous() work was.

https://patchwork.kernel.org/project/linux-rdma/list/?series=19461&archive=both&state=*

Regards,
Jason



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux