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  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, 28 May 2020 18:00:44 -0600
From:   Logan Gunthorpe <>
To:     Tom Murphy <>,
Cc:, David Airlie <>,,
        Bjorn Andersson <>,, Julien Grall <>,
        Thierry Reding <>,
        Will Deacon <>,
        Marek Szyprowski <>,
        Jean-Philippe Brucker <>,, Marc Zyngier <>,
        Krzysztof Kozlowski <>,
        Jonathan Hunter <>,, Andy Gross <>,,,,,
        Eric Auger <>,
        Alex Williamson <>,,
        Rodrigo Vivi <>,
        Matthias Brugger <>,
        Thomas Gleixner <>,,
        Gerald Schaefer <>,
        David Woodhouse <>,
        Cornelia Huck <>,, Kukjin Kim <>,
        Robin Murphy <>,
        Lu Baolu <>
Subject: Re: [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

Hi Tom,

On 2019-12-21 8:03 a.m., Tom Murphy wrote:
> This patchset converts the intel iommu driver to the dma-iommu api.

Just wanted to note that I've rebased your series on recent kernels and
have done some testing on my old Sandybridge machine (without the DO NOT
MERGE patch) and have found no issues. I hope this can make progress
soon and get merged soon. If you like you can add:

Tested-By: Logan Gunthorpe <>

> While converting the driver I exposed a bug in the intel i915 driver which causes a huge amount of artifacts on the screen of my laptop. You can see a picture of it here:
> This issue is most likely in the i915 driver and is most likely caused by the driver not respecting the return value of the dma_map_ops::map_sg function. You can see the driver ignoring the return value here:
> Previously this didn’t cause issues because the intel map_sg always returned the same number of elements as the input scatter gather list but with the change to this dma-iommu api this is no longer the case. I wasn’t able to track the bug down to a specific line of code unfortunately.  

I did some digging into this myself and while I don't have full patch, I
think I traced it closer to the problem.

Sadly, ignoring the number of nents returned by map_sg() is endemic to
dma-buf users, but AMD's GPU driver seems to do the same thing,
presumably without issues.

Digging a bit further, I found that the i915 has an "innovative" way of
iterating through SGLs, see [1]. I suspect if __sgt_iter is changed to
increment with sg_dma_len() and return NULL when there is no length
left, it may fix the issue.

But, sorry, I don't really have the means or time to fix and test this




Powered by blists - more mailing lists