linux-loongson/drivers/iommu/riscv
XianLiang Huang 99d4d1a070 iommu/riscv: prevent NULL deref in iova_to_phys
The riscv_iommu_pte_fetch() function returns either NULL for
unmapped/never-mapped iova, or a valid leaf pte pointer that
requires no further validation.

riscv_iommu_iova_to_phys() failed to handle NULL returns.
Prevent null pointer dereference in
riscv_iommu_iova_to_phys(), and remove the pte validation.

Fixes: 488ffbf181 ("iommu/riscv: Paging domain support")
Cc: Tomasz Jeznach <tjeznach@rivosinc.com>
Signed-off-by: XianLiang Huang <huangxianliang@lanxincomputing.com>
Link: https://lore.kernel.org/r/20250820072248.312-1-huangxianliang@lanxincomputing.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2025-08-22 08:51:49 +02:00
..
iommu-bits.h iommu/riscv: Command and fault queue support 2024-10-29 09:46:29 +01:00
iommu-pci.c iommu/riscv: Add shutdown function for iommu driver 2025-01-06 12:38:11 +01:00
iommu-platform.c iommu/riscv: Add shutdown function for iommu driver 2025-01-06 12:38:11 +01:00
iommu.c iommu/riscv: prevent NULL deref in iova_to_phys 2025-08-22 08:51:49 +02:00
iommu.h iommu/riscv: Add shutdown function for iommu driver 2025-01-06 12:38:11 +01:00
Kconfig
Makefile iommu: make inclusion of riscv directory conditional 2025-05-16 08:46:47 +02:00