special-register-buffer-data-sampling.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. .. SPDX-License-Identifier: GPL-2.0
  2. SRBDS - Special Register Buffer Data Sampling
  3. =============================================
  4. SRBDS is a hardware vulnerability that allows MDS
  5. Documentation/admin-guide/hw-vuln/mds.rst techniques to
  6. infer values returned from special register accesses. Special register
  7. accesses are accesses to off core registers. According to Intel's evaluation,
  8. the special register reads that have a security expectation of privacy are
  9. RDRAND, RDSEED and SGX EGETKEY.
  10. When RDRAND, RDSEED and EGETKEY instructions are used, the data is moved
  11. to the core through the special register mechanism that is susceptible
  12. to MDS attacks.
  13. Affected processors
  14. -------------------
  15. Core models (desktop, mobile, Xeon-E3) that implement RDRAND and/or RDSEED may
  16. be affected.
  17. A processor is affected by SRBDS if its Family_Model and stepping is
  18. in the following list, with the exception of the listed processors
  19. exporting MDS_NO while Intel TSX is available yet not enabled. The
  20. latter class of processors are only affected when Intel TSX is enabled
  21. by software using TSX_CTRL_MSR otherwise they are not affected.
  22. ============= ============ ========
  23. common name Family_Model Stepping
  24. ============= ============ ========
  25. IvyBridge 06_3AH All
  26. Haswell 06_3CH All
  27. Haswell_L 06_45H All
  28. Haswell_G 06_46H All
  29. Broadwell_G 06_47H All
  30. Broadwell 06_3DH All
  31. Skylake_L 06_4EH All
  32. Skylake 06_5EH All
  33. Kabylake_L 06_8EH <= 0xC
  34. Kabylake 06_9EH <= 0xD
  35. ============= ============ ========
  36. Related CVEs
  37. ------------
  38. The following CVE entry is related to this SRBDS issue:
  39. ============== ===== =====================================
  40. CVE-2020-0543 SRBDS Special Register Buffer Data Sampling
  41. ============== ===== =====================================
  42. Attack scenarios
  43. ----------------
  44. An unprivileged user can extract values returned from RDRAND and RDSEED
  45. executed on another core or sibling thread using MDS techniques.
  46. Mitigation mechanism
  47. --------------------
  48. Intel will release microcode updates that modify the RDRAND, RDSEED, and
  49. EGETKEY instructions to overwrite secret special register data in the shared
  50. staging buffer before the secret data can be accessed by another logical
  51. processor.
  52. During execution of the RDRAND, RDSEED, or EGETKEY instructions, off-core
  53. accesses from other logical processors will be delayed until the special
  54. register read is complete and the secret data in the shared staging buffer is
  55. overwritten.
  56. This has three effects on performance:
  57. #. RDRAND, RDSEED, or EGETKEY instructions have higher latency.
  58. #. Executing RDRAND at the same time on multiple logical processors will be
  59. serialized, resulting in an overall reduction in the maximum RDRAND
  60. bandwidth.
  61. #. Executing RDRAND, RDSEED or EGETKEY will delay memory accesses from other
  62. logical processors that miss their core caches, with an impact similar to
  63. legacy locked cache-line-split accesses.
  64. The microcode updates provide an opt-out mechanism (RNGDS_MITG_DIS) to disable
  65. the mitigation for RDRAND and RDSEED instructions executed outside of Intel
  66. Software Guard Extensions (Intel SGX) enclaves. On logical processors that
  67. disable the mitigation using this opt-out mechanism, RDRAND and RDSEED do not
  68. take longer to execute and do not impact performance of sibling logical
  69. processors memory accesses. The opt-out mechanism does not affect Intel SGX
  70. enclaves (including execution of RDRAND or RDSEED inside an enclave, as well
  71. as EGETKEY execution).
  72. IA32_MCU_OPT_CTRL MSR Definition
  73. --------------------------------
  74. Along with the mitigation for this issue, Intel added a new thread-scope
  75. IA32_MCU_OPT_CTRL MSR, (address 0x123). The presence of this MSR and
  76. RNGDS_MITG_DIS (bit 0) is enumerated by CPUID.(EAX=07H,ECX=0).EDX[SRBDS_CTRL =
  77. 9]==1. This MSR is introduced through the microcode update.
  78. Setting IA32_MCU_OPT_CTRL[0] (RNGDS_MITG_DIS) to 1 for a logical processor
  79. disables the mitigation for RDRAND and RDSEED executed outside of an Intel SGX
  80. enclave on that logical processor. Opting out of the mitigation for a
  81. particular logical processor does not affect the RDRAND and RDSEED mitigations
  82. for other logical processors.
  83. Note that inside of an Intel SGX enclave, the mitigation is applied regardless
  84. of the value of RNGDS_MITG_DS.
  85. Mitigation control on the kernel command line
  86. ---------------------------------------------
  87. The kernel command line allows control over the SRBDS mitigation at boot time
  88. with the option "srbds=". The option for this is:
  89. ============= =============================================================
  90. off This option disables SRBDS mitigation for RDRAND and RDSEED on
  91. affected platforms.
  92. ============= =============================================================
  93. SRBDS System Information
  94. ------------------------
  95. The Linux kernel provides vulnerability status information through sysfs. For
  96. SRBDS this can be accessed by the following sysfs file:
  97. /sys/devices/system/cpu/vulnerabilities/srbds
  98. The possible values contained in this file are:
  99. ============================== =============================================
  100. Not affected Processor not vulnerable
  101. Vulnerable Processor vulnerable and mitigation disabled
  102. Vulnerable: No microcode Processor vulnerable and microcode is missing
  103. mitigation
  104. Mitigation: Microcode Processor is vulnerable and mitigation is in
  105. effect.
  106. Mitigation: TSX disabled Processor is only vulnerable when TSX is
  107. enabled while this system was booted with TSX
  108. disabled.
  109. Unknown: Dependent on
  110. hypervisor status Running on virtual guest processor that is
  111. affected but with no way to know if host
  112. processor is mitigated or vulnerable.
  113. ============================== =============================================
  114. SRBDS Default mitigation
  115. ------------------------
  116. This new microcode serializes processor access during execution of RDRAND,
  117. RDSEED ensures that the shared buffer is overwritten before it is released for
  118. reuse. Use the "srbds=off" kernel command line to disable the mitigation for
  119. RDRAND and RDSEED.