Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-15 Thread Alan Mikhak
On Tue, Oct 15, 2019 at 9:12 AM Logan Gunthorpe wrote: > > > > On 2019-10-15 3:55 a.m., Christoph Hellwig wrote: > > On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote: > >>> My goal is to not modify the Linux NVMe target code at all. The NVMe > >>> endpoint function driver currently does

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-15 Thread Alan Mikhak
On Tue, Oct 15, 2019 at 10:45 AM Logan Gunthorpe wrote: > > > > On 2019-10-15 11:40 a.m., Alan Mikhak wrote: > > On Tue, Oct 15, 2019 at 2:55 AM Christoph Hellwig > > wrote: > >> > >> On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote: > My goal is to not modify the Linux NVMe targ

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-15 Thread Logan Gunthorpe
On 2019-10-15 11:40 a.m., Alan Mikhak wrote: > On Tue, Oct 15, 2019 at 2:55 AM Christoph Hellwig wrote: >> >> On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote: My goal is to not modify the Linux NVMe target code at all. The NVMe endpoint function driver currently does the w

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-15 Thread Alan Mikhak
On Tue, Oct 15, 2019 at 2:55 AM Christoph Hellwig wrote: > > On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote: > > > My goal is to not modify the Linux NVMe target code at all. The NVMe > > > endpoint function driver currently does the work that is required. > > You will have to do some

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-15 Thread Logan Gunthorpe
On 2019-10-15 3:55 a.m., Christoph Hellwig wrote: > On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote: >>> My goal is to not modify the Linux NVMe target code at all. The NVMe >>> endpoint function driver currently does the work that is required. > > You will have to do some modificat

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-15 Thread Christoph Hellwig
On Mon, Oct 07, 2019 at 02:13:51PM -0700, Alan Mikhak wrote: > > My goal is to not modify the Linux NVMe target code at all. The NVMe > > endpoint function driver currently does the work that is required. You will have to do some modifications, as for example in PCIe you can have a n:1 relationshi

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-07 Thread Alan Mikhak
On Mon, Oct 7, 2019 at 9:44 AM Alan Mikhak wrote: > > On Sun, Oct 6, 2019 at 11:13 PM Christoph Hellwig wrote: > > > > On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > > > From: Alan Mikhak > > > > > > Modify sg_miter_stop() to validate the page pointer > > > before calling PageSla

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-07 Thread Alan Mikhak
On Sun, Oct 6, 2019 at 11:13 PM Christoph Hellwig wrote: > > On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > > From: Alan Mikhak > > > > Modify sg_miter_stop() to validate the page pointer > > before calling PageSlab(). This check prevents a crash > > that will occur if PageSlab()

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-06 Thread Christoph Hellwig
On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > From: Alan Mikhak > > Modify sg_miter_stop() to validate the page pointer > before calling PageSlab(). This check prevents a crash > that will occur if PageSlab() gets called with a page > pointer that is not backed by page struct. >

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-06 Thread Christoph Hellwig
On Tue, Oct 01, 2019 at 09:16:23AM -0300, Jason Gunthorpe wrote: > > If the virtual address obtained from ioremap() is not > > backed by a page struct, virt_to_page() returns an > > invalid page pointer. However, sg_copy_buffer() can > > correctly recover the original virtual address. Such > > addr

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-01 Thread Alan Mikhak
On Tue, Oct 1, 2019 at 10:44 AM Jason Gunthorpe wrote: > > On Tue, Oct 01, 2019 at 10:26:38AM -0700, Alan Mikhak wrote: > > > > > Cost of adding page structs to a large PCI I/O address range can be > > > > quite substantial. Allowing PCI I/O pages without page structs may be > > > > desirable. Per

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-01 Thread Jason Gunthorpe
On Tue, Oct 01, 2019 at 10:26:38AM -0700, Alan Mikhak wrote: > > > Cost of adding page structs to a large PCI I/O address range can be > > > quite substantial. Allowing PCI I/O pages without page structs may be > > > desirable. Perhaps it is worth considering this cost. > > > > This is generally a

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-01 Thread Alan Mikhak
On Tue, Oct 1, 2019 at 10:12 AM Jason Gunthorpe wrote: > > On Tue, Oct 01, 2019 at 10:09:48AM -0700, Alan Mikhak wrote: > > On Tue, Oct 1, 2019 at 5:16 AM Jason Gunthorpe wrote: > > > > > > On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > > > > From: Alan Mikhak > > > > > > > > Mod

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-01 Thread Jason Gunthorpe
On Tue, Oct 01, 2019 at 10:09:48AM -0700, Alan Mikhak wrote: > On Tue, Oct 1, 2019 at 5:16 AM Jason Gunthorpe wrote: > > > > On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > > > From: Alan Mikhak > > > > > > Modify sg_miter_stop() to validate the page pointer > > > before calling Pa

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-01 Thread Alan Mikhak
On Tue, Oct 1, 2019 at 5:16 AM Jason Gunthorpe wrote: > > On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > > From: Alan Mikhak > > > > Modify sg_miter_stop() to validate the page pointer > > before calling PageSlab(). This check prevents a crash > > that will occur if PageSlab() get

Re: [PATCH] scatterlist: Validate page before calling PageSlab()

2019-10-01 Thread Jason Gunthorpe
On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > From: Alan Mikhak > > Modify sg_miter_stop() to validate the page pointer > before calling PageSlab(). This check prevents a crash > that will occur if PageSlab() gets called with a page > pointer that is not backed by page struct. >

[PATCH] scatterlist: Validate page before calling PageSlab()

2019-09-30 Thread Alan Mikhak
From: Alan Mikhak Modify sg_miter_stop() to validate the page pointer before calling PageSlab(). This check prevents a crash that will occur if PageSlab() gets called with a page pointer that is not backed by page struct. A virtual address obtained from ioremap() for a physical address in PCI ad