Skip to contentSkip to conversation

Patch "iommu: Don't overwrite domain pointer when there is no default_domain" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message Apr 17, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

iommu: Don't overwrite domain pointer when there is no default_domain

to the 4.5-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-don-t-overwrite-domain-pointer-when-there-is-no-default_domain.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From eebb8034a5be8c2177cbf07ca2ecd2ff8a058958 Mon Sep 17 00:00:00 2001

From: Joerg Roedel <[email protected]>
Date: Mon, 4 Apr 2016 15:47:48 +0200
Subject: iommu: Don't overwrite domain pointer when there is no default_domain

From: Joerg Roedel <[email protected]>

commit eebb8034a5be8c2177cbf07ca2ecd2ff8a058958 upstream.

IOMMU drivers that do not support default domains, but make use of the the group->domain pointer can get that pointer overwritten with NULL on device add/remove.

Make sure this can't happen by only overwriting the domain pointer when it is NULL.

Fixes 1228236de5f9 ('iommu: Move default domain allocation to iommu_group_get_for_dev()')
---
 drivers/iommu/iommu.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/iommu.c +2 -1
@@ -848,7 +848,8 @@ struct iommu_group *iommu_group_get_for_
 	if (!group->default_domain) {
 		group->default_domain = __iommu_domain_alloc(dev->bus,
 							     IOMMU_DOMAIN_DMA);
-		group->domain = group->default_domain;
+		if (!group->domain)
+			group->domain = group->default_domain;
 	}
 
 	ret = iommu_group_add_device(group, dev);

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/iommu-don-t-overwrite-domain-pointer-when-there-is-no-default_domain.patch