Skip to content

Commit f4e0691

Browse files
docs: direct host owners to their distribution security advisories
Listing out individual kernel vulnerabilities will tend to be out of date and gives a false sense of security. Move up the recommendation to keep host & guest kernels up to date and give ALAS as an example for following security advisories. Signed-off-by: Derek Manwaring <[email protected]>
1 parent f186fe9 commit f4e0691

File tree

1 file changed

+15
-142
lines changed

1 file changed

+15
-142
lines changed

docs/prod-host-setup.md

Lines changed: 15 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Production Host Setup Recommendations
22

3-
Firecracker relies on KVM and on the processor virtualization features
4-
for workload isolation. Security guarantees and defense in depth can only be
5-
upheld, if the following list of recommendations are implemented in
6-
production.
3+
Firecracker relies on KVM and on the processor virtualization features for
4+
workload isolation. The host and guest kernels and host microcode must be
5+
regularly patched in accordance with your distribution's security advisories
6+
such as [ALAS](https://alas.aws.amazon.com/alas2023.html) for Amazon Linux.
7+
8+
Security guarantees and defense in depth can only be upheld, if the following
9+
list of recommendations are implemented in production.
710

811
## Firecracker Configuration
912

@@ -301,6 +304,14 @@ For vendor-specific recommendations, please consult the resources below:
301304
- AMD: [AMD Product Security](https://www.amd.com/en/resources/product-security.html)
302305
- ARM: [Speculative Processor Vulnerability](https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability)
303306

307+
##### [ARM only] Physical counter directly passed through to the guest
308+
309+
On ARM, the physical counter (i.e `CNTPCT`) it is returning the
310+
[actual EL1 physical counter value of the host][1]. From the discussions before
311+
merging this change [upstream][2], this seems like a conscious design decision
312+
of the ARM code contributors, giving precedence to performance over the ability
313+
to trap and control this in the hypervisor.
314+
304315
##### Verification
305316

306317
[spectre-meltdown-checker script](https://github.com/speed47/spectre-meltdown-checker)
@@ -315,143 +326,5 @@ downloaded and executed like:
315326
wget -O - https://meltdown.ovh | bash
316327
```
317328

318-
### Known kernel issues
319-
320-
General recommendation: Keep the host and the guest kernels up to date.
321-
322-
#### [CVE-2019-3016](https://nvd.nist.gov/vuln/detail/CVE-2019-3016)
323-
324-
##### Description
325-
326-
In a Linux KVM guest that has PV TLB enabled, a process in the guest kernel
327-
may be able to read memory locations from another process in the same guest.
328-
329-
##### Impact
330-
331-
Under certain conditions the TLB will contain invalid entries. A malicious
332-
attacker running on the guest can get access to the memory of other running
333-
process on that guest.
334-
335-
##### Vulnerable systems
336-
337-
The vulnerability affects systems where all the following conditions
338-
are present:
339-
340-
- the host kernel >= 4.10.
341-
- the guest kernel >= 4.16.
342-
- the `KVM_FEATURE_PV_TLB_FLUSH` is set in the CPUID of the
343-
guest. This is the `EAX` bit 9 in the `KVM_CPUID_FEATURES (0x40000001)` entry.
344-
345-
This can be checked by running
346-
347-
```bash
348-
cpuid -r
349-
```
350-
351-
and by searching for the entry corresponding to the leaf `0x40000001`.
352-
353-
Example output:
354-
355-
```console
356-
0x40000001 0x00: eax=0x200 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
357-
EAX 010004fb = 0010 0000 0000
358-
EAX Bit 9: KVM_FEATURE_PV_TLB_FLUSH = 1
359-
```
360-
361-
##### Mitigation
362-
363-
The vulnerability is fixed by the following host kernel
364-
[patches](https://lkml.org/lkml/2020/1/30/482).
365-
366-
The fix was integrated in the mainline kernel and in 4.19.103, 5.4.19, 5.5.3
367-
stable kernel releases. Please follow [kernel.org](https://www.kernel.org/) and
368-
once the fix is available in your stable release please update the host kernel.
369-
If you are not using a vanilla kernel, please check with Linux distro provider.
370-
371-
#### [CVE-2022-1789](https://nvd.nist.gov/vuln/detail/CVE-2022-1789)
372-
373-
##### Description
374-
375-
With shadow paging enabled, the `INVPCID` instruction results in a call to
376-
`kvm_mmu_invpcid_gva`. If `INVPCID` is executed with `CR0.PG=0`, the invlpg
377-
callback is not set and the result is a NULL pointer dereference.
378-
379-
##### Impact
380-
381-
A malicious attacker running on the guest can cause a DoS (Denial of Service).
382-
383-
##### Vulnerable systems
384-
385-
The vulnerability affects systems that have shadow paging enabled and use
386-
the following host kernel versions:
387-
388-
- 5.10.x prior to 5.10.119
389-
- 5.15.x prior to 5.15.44
390-
- 5.17.x prior to 5.17.12
391-
392-
Systems that use extended page table are not susceptible to this attack.
393-
To verify that extended page table is enabled, run the following command:
394-
395-
```bash
396-
cat /sys/module/kvm_intel/parameters/ept
397-
```
398-
399-
If the output is `Y` then KVM uses extended page table, otherwise if `N`
400-
then KVM uses shadow pages.
401-
402-
##### Mitigation
403-
404-
The vulnerability is fixed by [this commit][4]. The fix was integrated in
405-
5.10.119, 5.15.44 and 5.17.12 kernel releases.
406-
407-
#### [CVE-2022-26373](https://nvd.nist.gov/vuln/detail/CVE-2022-26373)
408-
409-
##### Description
410-
411-
Isolation boundaries between processes are vulnerable to a return stack
412-
buffer underflow. This may result in some processors allowing neighbouring
413-
guests to access data in other processes via local access.
414-
415-
This issue is not impacted by environments that make use of `RETPOLINE` as
416-
this results in [RSB stuffing implemented by KVM][5] which Firecracker uses
417-
exclusively.
418-
419-
##### Impact
420-
421-
A malicious attacker running on a guest can access information in other guests
422-
running on the same host.
423-
424-
##### Vulnerable systems
425-
426-
The vulnerability affects systems that do not have `RETPOLINE` enabled
427-
and use the following host kernel versions:
428-
429-
- 5.10.x prior to 5.10.135
430-
- 5.15.x prior to 5.15.57
431-
432-
See earlier in this document for checking `RETPOLINE` configuration.
433-
You can check the version of the kernel being used with:
434-
435-
```
436-
uname -r
437-
```
438-
439-
##### Mitigation
440-
441-
The vulnerability is fixed in [these releases][6] by the [commits merged upstream][7].
442-
443-
#### [ARM only] Physical counter directly passed through to the guest
444-
445-
On ARM, the physical counter (i.e `CNTPCT`) it is returning the
446-
[actual EL1 physical counter value of the host][1]. From the discussions before
447-
merging this change [upstream][2], this seems like a conscious design decision
448-
of the ARM code contributors, giving precedence to performance over the ability
449-
to trap and control this in the hypervisor.
450-
451329
[1]: https://elixir.free-electrons.com/linux/v4.14.203/source/virt/kvm/arm/hyp/timer-sr.c#L63
452330
[2]: https://lists.cs.columbia.edu/pipermail/kvmarm/2017-January/023323.html
453-
[3]: https://elixir.bootlin.com/linux/v4.17/source/include/uapi/linux/prctl.h#L212
454-
[4]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=9f46c187e2e680ecd9de7983e4d081c3391acc76
455-
[5]: https://elixir.bootlin.com/linux/v5.10.131/source/arch/x86/kvm/vmx/vmenter.S#L78
456-
[6]: https://alas.aws.amazon.com/cve/html/CVE-2022-26373.html
457-
[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce114c866860

0 commit comments

Comments
 (0)