lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e81fb3cc4f315f330c610dfb16bad50b7241f4c.camel@mediatek.com>
Date:   Mon, 28 Nov 2022 06:44:36 +0000
From:   Yong Wu (吴勇) <Yong.Wu@...iatek.com>
To:     "robin.murphy@....com" <robin.murphy@....com>,
        "joro@...tes.org" <joro@...tes.org>,
        "ribalda@...omium.org" <ribalda@...omium.org>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "will@...nel.org" <will@...nel.org>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>
Subject: Re: [PATCH] iommu/mediatek: Fix crash on isr after kexec()

On Fri, 2022-11-25 at 17:28 +0100, Ricardo Ribalda wrote:
> If the system is rebooted via isr(), the IRQ handler might be
> triggerd
> 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@...omium.org>
> ---
> To: Yong Wu <yong.wu@...iatek.com>
> To: Joerg Roedel <joro@...tes.org>
> To: Will Deacon <will@...nel.org>
> To: Robin Murphy <robin.murphy@....com>
> To: Matthias Brugger <matthias.bgg@...il.com>
> Cc: iommu@...ts.linux.dev
> Cc: linux-mediatek@...ts.infradead.org
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
> ---
>  drivers/iommu/mtk_iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index 2ab2ecfe01f8..17f6be5a5097 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,


Which SoC does this issue happen? Does this issue is happened in the 
upstream kernel or the downstream kernel? 

Normally each port enable the iommu defaultly. Let's print the error
log even though "dom" is null to check which port fail here. then
analyse the port's behavior.

if (!dom || report_iommu_fault(xx))
     dev_err_ratelimited(xx)

>  			       write ? IOMMU_FAULT_WRITE :
> IOMMU_FAULT_READ)) {
>  		dev_err_ratelimited(
>  			bank->parent_dev,
> 
> ---
> base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
> change-id: 20221125-mtk-iommu-13023f971298
> 
> Best regards,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ