lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABEDWGwTd1N5897kZKcfOWSFNxS67QHKFU6uiwHBp0BFJBDFtg@mail.gmail.com>
Date:   Tue, 1 Oct 2019 10:46:21 -0700
From:   Alan Mikhak <alan.mikhak@...ive.com>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     linux-kernel@...r.kernel.org, martin.petersen@...cle.com,
        alexios.zavras@...el.com, ming.lei@...hat.com,
        gregkh@...uxfoundation.org, tglx@...utronix.de,
        christophe.leroy@....fr, Palmer Dabbelt <palmer@...ive.com>,
        Paul Walmsley <paul.walmsley@...ive.com>
Subject: Re: [PATCH] scatterlist: Validate page before calling PageSlab()

On Tue, Oct 1, 2019 at 10:44 AM Jason Gunthorpe <jgg@...pe.ca> 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. Perhaps it is worth considering this cost.
> > >
> > > This is generally agreed, but nobody has figured out a solution.
> > >
> > > > Scatterlist has no problem doing its memcpy() from pages without a
> > > > page struct that were obtained from ioremap(). It is only at
> > >
> > > Calling memcpy on pointers from ioremap is very much not allowed. Code
> > > has to use the iomem safe memcpy.
> >
> > Is it in the realm of possible to add support for such PCI I/O pages
> > to scatterlist? Perhaps some solution is possible by adding a new
> > function, say sg_set_iomem_page(), and a new SG_MITER_IOMEM flag that
> > tells scatterlist to use iomem safe memcpy functions when the page is
> > not backed by page struct because it was obtained from ioremap(). This
> > flag can also be used at sg_miter_stop() to not call PageSlab() or
> > flush_kernel_dcache_page().
>
> People have tried many different things so far, it is more comple than
> just the copy functions as there is also sg_page to worry about.
>
> > If supporting PCI I/O pages is not possible, would it be possible to
> > check for invalid page pointers in sg_set_page() and communicate the
> > requirement for a page struct backing in its description?
>
> Clarifying the comments seems reasonable to me.
>
> Jason

Thanks Jason. I'll submit a patch to communicate the requirement in
the description of sg_set_page().

Alan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ