Linux 6.3-rc3 Adding Protection From Malicious Guests Hammering AMD's Secure Processor
A change sent in this Sunday ahead of the Linux 6.3-rc3 release is a late addition adding a throttling mechanism to protect the hypervisor from potentially malicious AMD Secure Encrypted Virtualization (SEV) guests. The change is to protect the AMD Secure Processor from being potentially overloaded with requests by nefarious guest VMs.
Google engineer Dionna Glaze has been working on this "throttling awareness" support for AMD SEV guests and this Linux kernel code was agreed to by AMD's Linux engineers. Dionna Glaze explained in one of the patches for this AMD SEV throttling:
Given the security nature of this change, it was sent in now that the code is deemed ready and outside of the usual kernel merge window period. These AMD SEV patches were sent in today as part of the x86/urgent pull request prior to tonight's Linux 6.3-rc3 release.
These AMD SEV throttling patches are also marked as candidates for back-porting to the stable kernel series to further help fend off potentially malicious VM users trying to overload the AMD Secure Processor.
Google engineer Dionna Glaze has been working on this "throttling awareness" support for AMD SEV guests and this Linux kernel code was agreed to by AMD's Linux engineers. Dionna Glaze explained in one of the patches for this AMD SEV throttling:
"A potentially malicious SEV guest can constantly hammer the hypervisor using this driver to send down requests and thus prevent or at least considerably hinder other guests from issuing requests to the secure processor which is a shared platform resource.
Therefore, the host is permitted and encouraged to throttle such guest requests.
Add the capability to handle the case when the hypervisor throttles excessive numbers of requests issued by the guest. Otherwise, the VM platform communication key will be disabled, preventing the guest from attesting itself.
Realistically speaking, a well-behaved guest should not even care about throttling. During its lifetime, it would end up issuing a handful of requests which the hardware can easily handle.
This is more to address the case of a malicious guest. Such guest should get throttled and if its VMPCK gets disabled, then that's its own wrongdoing and perhaps that guest even deserves it.
To the implementation: the hypervisor signals with SNP_GUEST_REQ_ERR_BUSY that the guest requests should be throttled. That error code is returned in the upper 32-bit half of exitinfo2 and this is part of the GHCB spec v2.
So the guest is given a throttling period of 1 minute in which it retries the request every 2 seconds. This is a good default but if it turns out to not pan out in practice, it can be tweaked later."
Given the security nature of this change, it was sent in now that the code is deemed ready and outside of the usual kernel merge window period. These AMD SEV patches were sent in today as part of the x86/urgent pull request prior to tonight's Linux 6.3-rc3 release.
These AMD SEV throttling patches are also marked as candidates for back-porting to the stable kernel series to further help fend off potentially malicious VM users trying to overload the AMD Secure Processor.
1 Comment