[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181207171116.GA29923@bombadil.infradead.org>
Date: Fri, 7 Dec 2018 09:11:16 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Robin Murphy <robin.murphy@....com>
Cc: Souptick Joarder <jrdr.linux@...il.com>, akpm@...ux-foundation.org,
mhocko@...e.com, kirill.shutemov@...ux.intel.com, vbabka@...e.cz,
riel@...riel.com, sfr@...b.auug.org.au, rppt@...ux.vnet.ibm.com,
peterz@...radead.org, linux@...linux.org.uk,
iamjoonsoo.kim@....com, treding@...dia.com, keescook@...omium.org,
m.szyprowski@...sung.com, stefanr@...6.in-berlin.de,
hjc@...k-chips.com, heiko@...ech.de, airlied@...ux.ie,
oleksandr_andrushchenko@...m.com, joro@...tes.org,
pawel@...iak.com, kyungmin.park@...sung.com, mchehab@...nel.org,
boris.ostrovsky@...cle.com, jgross@...e.com,
linux-kernel@...r.kernel.org, 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 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;
Powered by blists - more mailing lists