On 6/22/21 7:06 AM, Robin Murphy wrote:
> Yeah, it's simple and unobtrusive enough that I reckon it's worth going
> straight to the common version if it's worth doing at all.
> On second thoughts this is overkill anyway - if you do hook
> iommu_get_def_domain_type(), you're done (in terms of the kernel-managed
> setting, at least); it doesn't matter what iommu_def_domain_type gets
> set to if will never get used. However, since this isn't really a
> per-device thing, it might be more semantically appropriate to leave
> that alone and instead only massage the default type in
> iommu_subsys_init(), as for memory encryption.
>
> When you say "secure the environment", what's the actual threat model
> here, i.e. who's securing what against whom? If it's a device lockdown
> type thing where the system owner wants to defend against the end user
> trying to mess with the software stack or gain access to parts they
> shouldn't, then possibly you can trust the command line, but there are
> definitely other places which need consideration. If on the other hand
> it's more about giving the end user confidence that their choice of
> software stack isn't being interfered with by a malicious host or
> external third parties, then it probably leans towards the opposite
> being true...
>
> If the command line *is* within the threat model, consider "iommu=off"
> and/or "intel_iommu=off" for example: I don't know how PMRs work, but I
> can only imagine that that's liable to leave things either wide open, or
> blocked to the point of no DMA working at all, neither of which seems to
> be what you want. I'm guessing "intel_iommu=tboot_noforce" might have
> some relevant implications too.
Thank you for you suggestions and feedback. Sorry we did not get back
sooner. After the comments from you and Andy Lutomirski we decided we
needed to re-imagine what we are trying to accomplish here and how else
we might approach it.
Ross
>
>>> It might be reasonable to make IOMMU_DEFAULT_PASSTHROUGH depend on
>>> !SECURE_LAUNCH for clarity though.
>>
>> This came from a specific request to not make disabling IOMMU modes
>> build time dependent. This is because a secure launch enabled kernel can
>> also be booted as a general purpose kernel in cases where this is
>> desired.
>
> Ah, thanks for clarifying - I was wondering about that aspect. FWIW,
> note that that wouldn't actually change any functionality - it's a
> non-default config option anyway, and users could still override it
> either way in a non-secure-launch setup - but it sounds like it might be
> effectively superfluous if you do need to make a more active runtime
> decision anyway.
>
> Cheers,
> Robin.