Patch "iommu/mediatek: Fix crash on isr after kexec()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    iommu/mediatek: Fix crash on isr after kexec()

to the 6.1-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-mediatek-fix-crash-on-isr-after-kexec.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 56d2a63c9091e0c839b166535c5b377e69d4be25
Author: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date:   Mon Nov 28 23:16:48 2022 +0100

    iommu/mediatek: Fix crash on isr after kexec()
    
    [ Upstream commit 00ef8885a945c37551547d8ac8361cacd20c4e42 ]
    
    If the system is rebooted via isr(), the IRQ handler might
    be triggered before the domain is initialized. Resulting on
    an invalid memory access error.
    
    Fix:
    [    0.500930] Unable to handle kernel read from unreadable memory at virtual address 0000000000000070
    [    0.501166] Call trace:
    [    0.501174]  report_iommu_fault+0x28/0xfc
    [    0.501180]  mtk_iommu_isr+0x10c/0x1c0
    
    Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
    Reviewed-by: Robin Murphy <robin.murphy@xxxxxxx>
    Link: https://lore.kernel.org/r/20221125-mtk-iommu-v2-0-e168dff7d43e@xxxxxxxxxxxx
    [ joro: Fixed spelling in commit message ]
    Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index dad2f238ffbf..56d007582b6f 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -454,7 +454,7 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id)
 		fault_larb = data->plat_data->larbid_remap[fault_larb][sub_comm];
 	}
 
-	if (report_iommu_fault(&dom->domain, bank->parent_dev, fault_iova,
+	if (!dom || report_iommu_fault(&dom->domain, bank->parent_dev, fault_iova,
 			       write ? IOMMU_FAULT_WRITE : IOMMU_FAULT_READ)) {
 		dev_err_ratelimited(
 			bank->parent_dev,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux