* Re: [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables
2025-11-07 19:09 [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables Ryan Huang
@ 2025-11-07 19:16 ` Jason Gunthorpe
2025-11-07 19:30 ` Pranjal Shrivastava
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2025-11-07 19:16 UTC (permalink / raw)
To: Ryan Huang
Cc: Will Deacon, Robin Murphy, Joerg Roedel, Nicolin Chen,
Pranjal Shrivastava, Kevin Tian, Lu Baolu, linux-arm-kernel,
iommu, linux-kernel, Daniel Mentz
On Fri, Nov 07, 2025 at 11:09:17AM -0800, Ryan Huang wrote:
> In arm_smmu_alloc_cd_tables(), the error check following the
> dma_alloc_coherent() for cd_table->l2.l1tab incorrectly tests
> cd_table->l2.l2ptrs.
>
> This means an allocation failure for l1tab goes undetected, causing
> the function to return 0 (success) erroneously.
>
> Correct the check to test cd_table->l2.l1tab.
>
> Fixes: e3b1be2e73db ("iommu/arm-smmu-v3: Reorganize struct arm_smmu_ctx_desc_cfg")
> Signed-off-by: Daniel Mentz <danielmentz@google.com>
> Signed-off-by: Ryan Huang <tzukui@google.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables
2025-11-07 19:09 [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables Ryan Huang
2025-11-07 19:16 ` Jason Gunthorpe
@ 2025-11-07 19:30 ` Pranjal Shrivastava
2025-11-07 19:45 ` Nicolin Chen
2025-11-24 19:18 ` Will Deacon
3 siblings, 0 replies; 5+ messages in thread
From: Pranjal Shrivastava @ 2025-11-07 19:30 UTC (permalink / raw)
To: Ryan Huang
Cc: Will Deacon, Robin Murphy, Joerg Roedel, Jason Gunthorpe,
Nicolin Chen, Kevin Tian, Lu Baolu, linux-arm-kernel, iommu,
linux-kernel, Daniel Mentz
On Fri, Nov 07, 2025 at 11:09:17AM -0800, Ryan Huang wrote:
> In arm_smmu_alloc_cd_tables(), the error check following the
> dma_alloc_coherent() for cd_table->l2.l1tab incorrectly tests
> cd_table->l2.l2ptrs.
>
> This means an allocation failure for l1tab goes undetected, causing
> the function to return 0 (success) erroneously.
>
> Correct the check to test cd_table->l2.l1tab.
>
> Fixes: e3b1be2e73db ("iommu/arm-smmu-v3: Reorganize struct arm_smmu_ctx_desc_cfg")
> Signed-off-by: Daniel Mentz <danielmentz@google.com>
> Signed-off-by: Ryan Huang <tzukui@google.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Thanks for the fix!
-Praan
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables
2025-11-07 19:09 [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables Ryan Huang
2025-11-07 19:16 ` Jason Gunthorpe
2025-11-07 19:30 ` Pranjal Shrivastava
@ 2025-11-07 19:45 ` Nicolin Chen
2025-11-24 19:18 ` Will Deacon
3 siblings, 0 replies; 5+ messages in thread
From: Nicolin Chen @ 2025-11-07 19:45 UTC (permalink / raw)
To: Ryan Huang
Cc: Will Deacon, Robin Murphy, Joerg Roedel, Jason Gunthorpe,
Pranjal Shrivastava, Kevin Tian, Lu Baolu, linux-arm-kernel,
iommu, linux-kernel, Daniel Mentz
On Fri, Nov 07, 2025 at 11:09:17AM -0800, Ryan Huang wrote:
> In arm_smmu_alloc_cd_tables(), the error check following the
> dma_alloc_coherent() for cd_table->l2.l1tab incorrectly tests
> cd_table->l2.l2ptrs.
>
> This means an allocation failure for l1tab goes undetected, causing
> the function to return 0 (success) erroneously.
>
> Correct the check to test cd_table->l2.l1tab.
>
> Fixes: e3b1be2e73db ("iommu/arm-smmu-v3: Reorganize struct arm_smmu_ctx_desc_cfg")
> Signed-off-by: Daniel Mentz <danielmentz@google.com>
> Signed-off-by: Ryan Huang <tzukui@google.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables
2025-11-07 19:09 [PATCH] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables Ryan Huang
` (2 preceding siblings ...)
2025-11-07 19:45 ` Nicolin Chen
@ 2025-11-24 19:18 ` Will Deacon
3 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2025-11-24 19:18 UTC (permalink / raw)
To: Robin Murphy, Joerg Roedel, Jason Gunthorpe, Nicolin Chen,
Pranjal Shrivastava, Kevin Tian, Lu Baolu, Ryan Huang
Cc: catalin.marinas, kernel-team, Will Deacon, linux-arm-kernel,
iommu, linux-kernel, Daniel Mentz
On Fri, 07 Nov 2025 11:09:17 -0800, Ryan Huang wrote:
> In arm_smmu_alloc_cd_tables(), the error check following the
> dma_alloc_coherent() for cd_table->l2.l1tab incorrectly tests
> cd_table->l2.l2ptrs.
>
> This means an allocation failure for l1tab goes undetected, causing
> the function to return 0 (success) erroneously.
>
> [...]
Applied to iommu (arm/smmu/updates), thanks!
[1/1] iommu/arm-smmu-v3: Fix error check in arm_smmu_alloc_cd_tables
https://git.kernel.org/iommu/c/5941f0e0c1e0
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 5+ messages in thread