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

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

 



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().

Doug/Jason/etc?

(There's also scif_munmap() that clears vm_ops, but at minmap time it
doesn't really matter..)

                 Linus



[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