IOMMU Fixes for Linux v6.19-rc6

Including:
 
 	- AMD IOMMU: Fix potential NULL-ptr dereference in error path of
 	  amd_iommu_probe_device().
 
 	- Generic IOMMUPT: Fix another compiler issue seen with older compiler
 	  versions.
 
 	- Fix signedness issue in ARM IO-PageTable code.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAmlzOg0ACgkQK/BELZcB
 GuMQRhAAhgPw7RD6NPEb67NG4g28tuDBLEWBc10IS0d0XjP5QZCcFT3wLY4CYDsK
 J5QRDgYv6sACaOWgv5oB4N2WffqC6nC2YVniOmmq3s2Emfk/5eAo0MpRchvdiVDD
 F6tuUU/RwmeuUbK/6pa6SDrRsXy/SgQI858FkvVQSk8Ngj0ECFoUyJCbaqODzpP6
 Cxp2KyY0FqcfssGtf6uFMSvXhC0CrFOwWHBXp5UzMOPnEHABxMUdQEHTfsR631bt
 IrYphkspnhfMpeAntZxpqAeejWnWcMf3nYlwt5j1UxjUuvfNtloc6hHFb6ln+/ad
 BG0wX5kqOK4LC4oiStz3qo9eMWrmbvG8L32Wpo8iPxd1CJ+Lu2+EaaHAYDrgoMo2
 ApRAEEApzDkuGK61J3a1Ff2eg2WInBXmY55VXH2rBA2wnUrZKwYriivojt6ySXWz
 g6RpOWHxo6ztQN/C7VynqnvaQ5WKMHG9AhL2M6jQtP16obCz9hJut0Ps3v6AbOl2
 9bQDTAEnFAi+ribCqg4PFKlcVg8wLqjDQJQLRO/hbATfV/mY0loyRVIHdyPuQUya
 IP1iKZn2LNwsYgl0AtrcDvXojl6CD/T1W5XjR0Q5hrNbWk1CSi2GmXMJFCiKV0pu
 fzS6Sv/8DS2tE1QgG4IAgbEqqb0TKeOdWcYFdZP/WRgaC8tPTeM=
 =k63u
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v6.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull iommu fixes from Joerg Roedel:

 - AMD IOMMU: Fix potential NULL-ptr dereference in error path
   of amd_iommu_probe_device()

 - Generic IOMMUPT: Fix another compiler issue seen with older
   compiler versions

 - Fix signedness issue in ARM IO-PageTable code

* tag 'iommu-fixes-v6.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
  iommu/io-pgtable-arm: fix size_t signedness bug in unmap path
  iommupt: Make it clearer to the compiler that pts.level == 0 for single page
  iommu/amd: Fix error path in amd_iommu_probe_device()
master
Linus Torvalds 2026-01-23 12:46:12 -08:00
commit b33d706259
3 changed files with 3 additions and 4 deletions

View File

@ -2450,8 +2450,6 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
goto out_err;
}
out_err:
iommu_completion_wait(iommu);
if (FEATURE_NUM_INT_REMAP_SUP_2K(amd_iommu_efr2))
@ -2462,6 +2460,7 @@ out_err:
if (dev_is_pci(dev))
pci_prepare_ats(to_pci_dev(dev), PAGE_SHIFT);
out_err:
return iommu_dev;
}

View File

@ -645,7 +645,7 @@ static __always_inline int __do_map_single_page(struct pt_range *range,
struct pt_iommu_map_args *map = arg;
pts.type = pt_load_single_entry(&pts);
if (level == 0) {
if (pts.level == 0) {
if (pts.type != PT_ENTRY_EMPTY)
return -EADDRINUSE;
pt_install_leaf_entry(&pts, map->oa, PAGE_SHIFT,

View File

@ -637,7 +637,7 @@ static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
pte = READ_ONCE(*ptep);
if (!pte) {
WARN_ON(!(data->iop.cfg.quirks & IO_PGTABLE_QUIRK_NO_WARN));
return -ENOENT;
return 0;
}
/* If the size matches this level, we're in the right place */