[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFqt6zYCWOK-uS85GqCzcgT=+YKn1nBrRPq+M9y6eJjmXEKH+g@mail.gmail.com>
Date: Sat, 8 Dec 2018 00:58:26 +0530
From: Souptick Joarder <jrdr.linux@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: robin.murphy@....com, Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
vbabka@...e.cz, Rik van Riel <riel@...riel.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
rppt@...ux.vnet.ibm.com, Peter Zijlstra <peterz@...radead.org>,
Russell King - ARM Linux <linux@...linux.org.uk>,
iamjoonsoo.kim@....com, treding@...dia.com,
Kees Cook <keescook@...omium.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
stefanr@...6.in-berlin.de, hjc@...k-chips.com,
Heiko Stuebner <heiko@...ech.de>, airlied@...ux.ie,
oleksandr_andrushchenko@...m.com, joro@...tes.org,
pawel@...iak.com, Kyungmin Park <kyungmin.park@...sung.com>,
mchehab@...nel.org, Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org,
Linux-MM <linux-mm@...ck.org>,
linux-arm-kernel@...ts.infradead.org,
linux1394-devel@...ts.sourceforge.net,
dri-devel@...ts.freedesktop.org,
linux-rockchip@...ts.infradead.org, xen-devel@...ts.xen.org,
iommu@...ts.linux-foundation.org, linux-media@...r.kernel.org
Subject: Re: [PATCH v3 1/9] mm: Introduce new vm_insert_range API
On Fri, Dec 7, 2018 at 10:41 PM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Fri, Dec 07, 2018 at 03:34:56PM +0000, Robin Murphy wrote:
> > > +int vm_insert_range(struct vm_area_struct *vma, unsigned long addr,
> > > + struct page **pages, unsigned long page_count)
> > > +{
> > > + unsigned long uaddr = addr;
> > > + int ret = 0, i;
> >
> > Some of the sites being replaced were effectively ensuring that vma and
> > pages were mutually compatible as an initial condition - would it be worth
> > adding something here for robustness, e.g.:
> >
> > + if (page_count != vma_pages(vma))
> > + return -ENXIO;
>
> I think we want to allow this to be used to populate part of a VMA.
> So perhaps:
>
> if (page_count > vma_pages(vma))
> return -ENXIO;
Ok, This can be added.
I think Patch [2/9] is the only leftover place where this
check could be removed.
Powered by blists - more mailing lists