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

From: Christoph Hellwig
Date: Mon Oct 07 2019 - 02:13:29 EST


On Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote:
> From: Alan Mikhak <alan.mikhak@xxxxxxxxxx>
>
> 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 address space can be assigned to a
> scatterlist segment using the public scatterlist API
> as in the following example:

As Jason pointed out that is not a valid use of scatterlist. What
are you trying to do here at a higher level?