l1d_flush.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. L1D Flushing
  2. ============
  3. With an increasing number of vulnerabilities being reported around data
  4. leaks from the Level 1 Data cache (L1D) the kernel provides an opt-in
  5. mechanism to flush the L1D cache on context switch.
  6. This mechanism can be used to address e.g. CVE-2020-0550. For applications
  7. the mechanism keeps them safe from vulnerabilities, related to leaks
  8. (snooping of) from the L1D cache.
  9. Related CVEs
  10. ------------
  11. The following CVEs can be addressed by this
  12. mechanism
  13. ============= ======================== ==================
  14. CVE-2020-0550 Improper Data Forwarding OS related aspects
  15. ============= ======================== ==================
  16. Usage Guidelines
  17. ----------------
  18. Please see document: :ref:`Documentation/userspace-api/spec_ctrl.rst
  19. <set_spec_ctrl>` for details.
  20. **NOTE**: The feature is disabled by default, applications need to
  21. specifically opt into the feature to enable it.
  22. Mitigation
  23. ----------
  24. When PR_SET_L1D_FLUSH is enabled for a task a flush of the L1D cache is
  25. performed when the task is scheduled out and the incoming task belongs to a
  26. different process and therefore to a different address space.
  27. If the underlying CPU supports L1D flushing in hardware, the hardware
  28. mechanism is used, software fallback for the mitigation, is not supported.
  29. Mitigation control on the kernel command line
  30. ---------------------------------------------
  31. The kernel command line allows to control the L1D flush mitigations at boot
  32. time with the option "l1d_flush=". The valid arguments for this option are:
  33. ============ =============================================================
  34. on Enables the prctl interface, applications trying to use
  35. the prctl() will fail with an error if l1d_flush is not
  36. enabled
  37. ============ =============================================================
  38. By default the mechanism is disabled.
  39. Limitations
  40. -----------
  41. The mechanism does not mitigate L1D data leaks between tasks belonging to
  42. different processes which are concurrently executing on sibling threads of
  43. a physical CPU core when SMT is enabled on the system.
  44. This can be addressed by controlled placement of processes on physical CPU
  45. cores or by disabling SMT. See the relevant chapter in the L1TF mitigation
  46. document: :ref:`Documentation/admin-guide/hw-vuln/l1tf.rst <smt_control>`.
  47. **NOTE** : The opt-in of a task for L1D flushing works only when the task's
  48. affinity is limited to cores running in non-SMT mode. If a task which
  49. requested L1D flushing is scheduled on a SMT-enabled core the kernel sends
  50. a SIGBUS to the task.