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-next>] [day] [month] [year] [list]
Message-Id: <20230102093452.761185-1-schnelle@linux.ibm.com>
Date:   Mon,  2 Jan 2023 10:34:51 +0100
From:   Niklas Schnelle <schnelle@...ux.ibm.com>
To:     Alex Williamson <alex.williamson@...hat.com>,
        Cornelia Huck <cohuck@...hat.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org,
        Matthew Rosato <mjrosato@...ux.ibm.com>,
        Pierre Morel <pmorel@...ux.ibm.com>,
        Christian Bornträger <borntraeger@...ux.ibm.com>
Subject: [PATCH 0/1] vfio/type1: Fix vfio-pci pass-through of ISM devices

Hi Alex,

Since commit cbf7827bc5dc ("iommu/s390: Fix potential s390_domain aperture
shrinking") the s390 IOMMU driver uses a reserved region instead of an
artificially shrunk aperture to restrict IOMMU use based on the system provided
DMA ranges of devices. While this is more aligned with the common code use
of apertures and reserved regions it turns out this currently breaks vfio-pci
pass-through of our special virtual ISM PCI device. Investigation showed that
this is due to vfio_test_domain_fgsp() ignoring the IOMMU reserved regions and
mapping IOVA address 0 even if that falls within a reserved region. Thus
I propose the below patch to make vfio_test_domain_fgsp() find a region to do
its mapping test instead of blindly using IOVA 0. 

I did post the below patch independently already on December 22 but the subject
wording didn't make it clear that this fixes a real problem and of course the
holidays contribute to making things easier to miss so I wanted to post again
with a bit more background and a more catchy/clear subject on the cover letter.

As for testing, I tested this based on current master on both on s390 where it
skips the reserved 0x0-0x100000000 range and on an AMD Ryzen 3990X where it
continues to do the test on DMA address 0 and sets domain->fgsp to true.

Thanks,
Niklas Schnelle

Niklas Schnelle (1):
  vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()

 drivers/vfio/vfio_iommu_type1.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ