]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommufd: Fix missing update of domains_itree after splitting iopt_area
authorKoichiro Den <den@valinux.co.jp>
Fri, 27 Oct 2023 16:29:42 +0000 (01:29 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:15:01 +0000 (17:15 +0000)
commit836db2e7e4565d8218923b3552304a1637e2f28d
treea484eba3e49a528d4c7a17503cb5747d880cc6ee
parent38fae890594a09b4763a90acdafb068a83ec5ae1
iommufd: Fix missing update of domains_itree after splitting iopt_area

commit e7250ab7ca4998fe026f2149805b03e09dc32498 upstream.

In iopt_area_split(), if the original iopt_area has filled a domain and is
linked to domains_itree, pages_nodes have to be properly
reinserted. Otherwise the domains_itree becomes corrupted and we will UAF.

Fixes: 51fe6141f0f6 ("iommufd: Data structure to provide IOVA to PFN mapping")
Link: https://lore.kernel.org/r/20231027162941.2864615-2-den@valinux.co.jp
Cc: stable@vger.kernel.org
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/iommufd/io_pagetable.c