Patch "iommu/dma: Don't put uninitialised IOVA domains" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
iommu/dma: Don't put uninitialised IOVA domains
to the 4.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-dma-don-t-put-uninitialised-iova-domains.patch
and it can be found in the queue-4.4 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
3ec60043f7c02e1f79e4a90045ff2d2e80042941Mon Sep 17 00:00:00 2001
From: Robin Murphy <[email protected]>
Date: Tue, 9 Aug 2016 16:23:17 +0100
Subject: iommu/dma: Don't put uninitialised IOVA domains
From: Robin Murphy <[email protected]>
commit 3ec60043f7c02e1f79e4a90045ff2d2e80042941 upstream.
Due to the limitations of having to wait until we see a device's DMA restrictions before we know how we want an IOVA domain initialised, there is a window for error if a DMA ops domain is allocated but later freed without ever being used. In that case, init_iova_domain() was never called, so calling put_iova_domain() from iommu_put_dma_cookie() ends up trying to take an uninitialised lock and crashing.
Make things robust by skipping the call unless the IOVA domain actually has been initialised, as we probably should have done from the start.
--- drivers/iommu/dma-iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +2 -1
@@ -68,7 +68,8 @@ void iommu_put_dma_cookie(struct iommu_dif (!iovad)return ; -put_iova_domain (iovad); +if (iovad->granule) +put_iova_domain (iovad);kfree (iovad); domain->iova_cookie =NULL ; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/iommu-arm-smmu-don-t-bug-if-we-find-aborting-stes-with-disable_bypass.patch queue-4.4/iommu-dma-don-t-put-uninitialised-iova-domains.patch