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]
Date:   Thu, 24 Jun 2021 10:07:14 +0200
From:   Christian König <christian.koenig@....com>
To:     Christoph Hellwig <hch@....de>, Oded Gabbay <oded.gabbay@...il.com>
Cc:     Jason Gunthorpe <jgg@...pe.ca>,
        Christian König <ckoenig.leichtzumerken@...il.com>,
        Gal Pressman <galpress@...zon.com>, sleybo@...zon.com,
        linux-rdma <linux-rdma@...r.kernel.org>,
        Oded Gabbay <ogabbay@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        "moderated list:DMA BUFFER SHARING FRAMEWORK" 
        <linaro-mm-sig@...ts.linaro.org>,
        Doug Ledford <dledford@...hat.com>,
        Tomer Tayar <ttayar@...ana.ai>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        Alex Deucher <alexander.deucher@....com>,
        Leon Romanovsky <leonro@...dia.com>,
        "open list:DMA BUFFER SHARING FRAMEWORK" 
        <linux-media@...r.kernel.org>
Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export
 FD for DMA-BUF

Am 24.06.21 um 07:34 schrieb Christoph Hellwig:
> On Wed, Jun 23, 2021 at 10:00:29PM +0300, Oded Gabbay wrote:
>> I understand the argument and I agree that for the generic case, the
>> top of the stack can't assume anything.
>> Having said that, in this case the SGL is encapsulated inside a dma-buf object.
> But the scatterlist is defined to have a valid page.  If in dma-bufs you
> can't do that dmabufs are completely broken.  Apparently the gpu folks
> can somehow live with that and deal with the pitfals, but for dma-buf
> users outside of their little fiefdom were they arbitrarily break rules
> it simply is not acceptable.

The key point is that accessing the underlying pages even when DMA-bufs 
are backed by system memory is illegal. Daniel even created a patch 
which mangles the page pointers in sg_tables used by DMA-buf to make 
sure that people don't try to use them.

So the conclusion is that using sg_table in the DMA-buf framework was 
just the wrong data structure and we should have invented a new one.

But then people would have complained that we have a duplicated 
infrastructure (which is essentially true).

My best plan to get out of this mess is that we change the DMA-buf 
interface to use an array of dma_addresses instead of the sg_table 
object and I have already been working on this actively the last few month.

Regards,
Christian.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ