Re: [PATCH v2] powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2023-05-05 02:22:25
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2023-05-05 02:22:25
Gaurav Batra [off-list ref] writes:
Hello Michael, I agree with your concerns regarding a device been able to access memory that doesn't belong to it. That exposure we have today with 2MB TCEs. With 2MB TCEs, DMA window size will be big enough, for dedicated adapters, that whole memory is going to be mapped "direct". Which essentially means, that a "rogue" device/driver has the potential to corrupt LPAR wide memory.
Yes that's always been a trade-off between performance and robustness, and performance is generally the winner. There have been various command line flags in the past to configure stricter behaviour, disable bypass etc. Some of those are now generic, iommu.strict/passthrough, it would be good to get them wired up to work on powerpc at some point.
I have sent you v3.
Thanks. cheers