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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87724722-b9f3-a016-c25c-4b0415f2c37f@amd.com>
Date:   Wed, 10 Aug 2022 20:25:08 +0200
From:   Christian König <christian.koenig@....com>
To:     Dmitry Osipenko <dmitry.osipenko@...labora.com>,
        Christian König <ckoenig.leichtzumerken@...il.com>,
        David Airlie <airlied@...ux.ie>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Gurchetan Singh <gurchetansingh@...omium.org>,
        Chia-I Wu <olvaffe@...il.com>, Daniel Vetter <daniel@...ll.ch>,
        Daniel Almeida <daniel.almeida@...labora.com>,
        Gert Wollny <gert.wollny@...labora.com>,
        Gustavo Padovan <gustavo.padovan@...labora.com>,
        Daniel Stone <daniel@...ishbar.org>,
        Tomeu Vizoso <tomeu.vizoso@...labora.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Rob Clark <robdclark@...il.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        Thierry Reding <thierry.reding@...il.com>,
        Tomasz Figa <tfiga@...omium.org>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Alex Deucher <alexander.deucher@....com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
        Thomas Hellström <thomas_os@...pmail.org>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Dmitry Osipenko <digetx@...il.com>,
        linux-media@...r.kernel.org, linaro-mm-sig@...ts.linaro.org,
        amd-gfx@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
        kernel@...labora.com, virtualization@...ts.linux-foundation.org,
        spice-devel@...ts.freedesktop.org, linux-rdma@...r.kernel.org,
        linux-arm-msm@...r.kernel.org
Subject: Re: [Linaro-mm-sig] [PATCH v2 3/5] dma-buf: Move all dma-bufs to
 dynamic locking specification

Am 10.08.22 um 19:49 schrieb Dmitry Osipenko:
> On 8/10/22 14:30, Christian König wrote:
>> Am 25.07.22 um 17:18 schrieb Dmitry Osipenko:
>>> This patch moves the non-dynamic dma-buf users over to the dynamic
>>> locking specification. The strict locking convention prevents deadlock
>>> situation for dma-buf importers and exporters.
>>>
>>> Previously the "unlocked" versions of the dma-buf API functions weren't
>>> taking the reservation lock and this patch makes them to take the lock.
>>>
>>> Intel and AMD GPU drivers already were mapping imported dma-bufs under
>>> the held lock, hence the "locked" variant of the functions are added
>>> for them and the drivers are updated to use the "locked" versions.
>> In general "Yes, please", but that won't be that easy.
>>
>> You not only need to change amdgpu and i915, but all drivers
>> implementing the map_dma_buf(), unmap_dma_buf() callbacks.
>>
>> Auditing all that code is a huge bunch of work.
> Hm, neither of drivers take the resv lock in map_dma_buf/unmap_dma_buf.
> It's easy to audit them all and I did it. So either I'm missing
> something or it doesn't take much time to check them all. Am I really
> missing something?

Ok, so this is only changing map/unmap now?

In this case please separate this from the documentation change.

I would also drop the _locked postfix from the function name, just 
having _unlocked on all functions which are supposed to be called with 
the lock held should be sufficient.

Thanks for looking into this,
Christian.

>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2FA%2Fident%2Fmap_dma_buf&amp;data=05%7C01%7Cchristian.koenig%40amd.com%7C70fd52d0a82a477bfbfe08da7af8bec7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637957506041914442%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=K47uCULsoiURjze0H0ksUa4vzJ%2BxqgoShH9106FvyyA%3D&amp;reserved=0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ