Return-Path: Received: from mail-io1-f65.google.com ([209.85.166.65]:45069 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbeI2AIa (ORCPT ); Fri, 28 Sep 2018 20:08:30 -0400 Received: by mail-io1-f65.google.com with SMTP id e12-v6so4738395iok.12 for ; Fri, 28 Sep 2018 10:43:39 -0700 (PDT) Date: Fri, 28 Sep 2018 11:43:37 -0600 From: Jason Gunthorpe To: Linus Torvalds Cc: Andrew Morton , Doug Ledford , Yishai Hadas , Lijun Ou , "Wei Hu(Xavier)" , stable , Oleg Nesterov , marcel.ziswiler@toradex.com, Dmitry Vyukov , Andrea Arcangeli , "Kirill A. Shutemov" , mm-commits@vger.kernel.org Subject: Re: [patch 2/6] mm: fix vma_is_anonymous() false-positives Message-ID: <20180928174337.GB17659@ziepe.ca> References: <20180721005335.JghLC%akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Sun, Jul 22, 2018 at 01:21:06PM -0700, Linus Torvalds wrote: > On Sat, Jul 21, 2018 at 3:49 PM Linus Torvalds > 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