[PATCH v2 RESEND] iommu/riscv: check pte null pointer before use

Paul Walmsley pjw at kernel.org
Thu Jun 25 12:10:07 PDT 2026


Hi,

On Thu, 7 Aug 2025, XianLiang Huang wrote:

> The riscv_iommu_pte_fetch can return NULL when the provided iova is not
> yet mapped, the caller should check if the returned pointer is NULL or
> not, but riscv_iommu_iova_to_phys missed this, which will then lead to
> a kernel panic.
> 
> Check the pointer before using it to avoid the bug. Now, when
> iova_to_phys is called with an unmapped iova, the kernel will not crash
> here.
> 
> Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support")
> Cc: Tomasz Jeznach <tjeznach at rivosinc.com>
> Signed-off-by: XianLiang Huang <huangxianliang at lanxincomputing.com>

Going through some of the Patchwork backlog.  The code that this patch 
changes no longer appears to exist.  Care to take a look to see if 
something like this is still appropriate?

thanks,


- Paul



More information about the linux-riscv mailing list