This is a note to let you know that I've just added the patch titled

    iommu: set group default domain before creating direct mappings

to the 5.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iommu-set-group-default-domain-before-creating-direct-mappings.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <sta...@vger.kernel.org> know about it.


>From d360211524bece6db9920f32c91808235290b51c Mon Sep 17 00:00:00 2001
From: Jerry Snitselaar <jsnit...@redhat.com>
Date: Tue, 10 Dec 2019 11:56:06 -0700
Subject: iommu: set group default domain before creating direct mappings

From: Jerry Snitselaar <jsnit...@redhat.com>

commit d360211524bece6db9920f32c91808235290b51c upstream.

iommu_group_create_direct_mappings uses group->default_domain, but
right after it is called, request_default_domain_for_dev calls
iommu_domain_free for the default domain, and sets the group default
domain to a different domain. Move the
iommu_group_create_direct_mappings call to after the group default
domain is set, so the direct mappings get associated with that domain.

Cc: Joerg Roedel <jroe...@suse.de>
Cc: Lu Baolu <baolu...@linux.intel.com>
Cc: iommu@lists.linux-foundation.org
Cc: sta...@vger.kernel.org
Fixes: 7423e01741dd ("iommu: Add API to request DMA domain for device")
Signed-off-by: Jerry Snitselaar <jsnit...@redhat.com>
Reviewed-by: Lu Baolu <baolu...@linux.intel.com>
Signed-off-by: Joerg Roedel <jroe...@suse.de>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/iommu/iommu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -2221,13 +2221,13 @@ request_default_domain_for_dev(struct de
                goto out;
        }
 
-       iommu_group_create_direct_mappings(group, dev);
-
        /* Make the domain the default for this group */
        if (group->default_domain)
                iommu_domain_free(group->default_domain);
        group->default_domain = domain;
 
+       iommu_group_create_direct_mappings(group, dev);
+
        dev_info(dev, "Using iommu %s mapping\n",
                 type == IOMMU_DOMAIN_DMA ? "dma" : "direct");
 


Patches currently in stable-queue which might be from jsnit...@redhat.com are

queue-5.4/iommu-fix-kasan-use-after-free-in-iommu_insert_resv_region.patch
queue-5.4/iommu-vt-d-fix-dmar-pte-read-access-not-set-error.patch
queue-5.4/iommu-set-group-default-domain-before-creating-direct-mappings.patch
queue-5.4/tpm_tis-reserve-chip-for-duration-of-tpm_tis_core_init.patch
queue-5.4/iommu-vt-d-allocate-reserved-region-for-isa-with-correct-permission.patch
queue-5.4/iommu-vt-d-set-isa-bridge-reserved-region-as-relaxable.patch
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to