On 19/04/2022 14:52, Juergen Gross wrote: > Today iommu_do_domctl() is being called from arch_do_domctl() in the > "default:" case of a switch statement. This has led already to crashes > due to unvalidated parameters. > > Fix that by moving the call of iommu_do_domctl() to the main switch > statement of do_domctl(). > > Signed-off-by: Juergen Gross <jgr...@suse.com> > --- > Another possibility would even be to merge iommu_do_domctl() completely > into do_domctl(), but I wanted to start with a less intrusive variant. > V3: > - new patch
I definitely prefer this approach, thanks. In addition to being clearer, it's also faster because there isn't a long line of "do you understand this subop?" calls when we know exactly what it is. However, I think we need stub for the !HAS_PASSTHROUGH case now that it is being called from common code. I'd forgotten that it was used on ARM now, and yes - it absolutely should be called from somewhere common, not from the arch hooks. ~Andrew