€•”Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ /translations/zh_CN/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/zh_TW/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/it_IT/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/ja_JP/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/ko_KR/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/pt_BR/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/sp_SP/arch/x86/mds”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ1Microarchitectural Data Sampling (MDS) mitigation”h]”hŒ1Microarchitectural Data Sampling (MDS) mitigation”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ:/var/lib/git/docbuild/linux/Documentation/arch/x86/mds.rst”h´KubhŒtarget”“”)”}”(hŒ.. _mds:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œmds”uh1hËh´Khh·h²hh³hÊubh¶)”}”(hhh]”(h»)”}”(hŒOverview”h]”hŒOverview”…””}”(hhÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhÙh²hh³hÊh´KubhŒ paragraph”“”)”}”(hŒMicroarchitectural Data Sampling (MDS) is a family of side channel attacks on internal buffers in Intel CPUs. The variants are:”h]”hŒMicroarchitectural Data Sampling (MDS) is a family of side channel attacks on internal buffers in Intel CPUs. The variants are:”…””}”(hhìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K hhÙh²hubhŒ block_quote”“”)”}”(hX&- Microarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126) - Microarchitectural Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130) - Microarchitectural Load Port Data Sampling (MLPDS) (CVE-2018-12127) - Microarchitectural Data Sampling Uncacheable Memory (MDSUM) (CVE-2019-11091) ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒFMicroarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126)”h]”hë)”}”(hj h]”hŒFMicroarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126)”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hŒEMicroarchitectural Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130)”h]”hë)”}”(hj h]”hŒEMicroarchitectural Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130)”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hŒCMicroarchitectural Load Port Data Sampling (MLPDS) (CVE-2018-12127)”h]”hë)”}”(hj7h]”hŒCMicroarchitectural Load Port Data Sampling (MLPDS) (CVE-2018-12127)”…””}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´Khj5ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hŒMMicroarchitectural Data Sampling Uncacheable Memory (MDSUM) (CVE-2019-11091) ”h]”hë)”}”(hŒLMicroarchitectural Data Sampling Uncacheable Memory (MDSUM) (CVE-2019-11091)”h]”hŒLMicroarchitectural Data Sampling Uncacheable Memory (MDSUM) (CVE-2019-11091)”…””}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KhjLubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jh³hÊh´K hhüubah}”(h]”h ]”h"]”h$]”h&]”uh1húh³hÊh´K hhÙh²hubhë)”}”(hXMSBDS leaks Store Buffer Entries which can be speculatively forwarded to a dependent load (store-to-load forwarding) as an optimization. The forward can also happen to a faulting or assisting load operation for a different memory address, which can be exploited under certain conditions. Store buffers are partitioned between Hyper-Threads so cross thread forwarding is not possible. But if a thread enters or exits a sleep state the store buffer is repartitioned which can expose data from one thread to the other.”h]”hXMSBDS leaks Store Buffer Entries which can be speculatively forwarded to a dependent load (store-to-load forwarding) as an optimization. The forward can also happen to a faulting or assisting load operation for a different memory address, which can be exploited under certain conditions. Store buffers are partitioned between Hyper-Threads so cross thread forwarding is not possible. But if a thread enters or exits a sleep state the store buffer is repartitioned which can expose data from one thread to the other.”…””}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KhhÙh²hubhë)”}”(hX/MFBDS leaks Fill Buffer Entries. Fill buffers are used internally to manage L1 miss situations and to hold data which is returned or sent in response to a memory or I/O operation. Fill buffers can forward data to a load operation and also write data to the cache. When the fill buffer is deallocated it can retain the stale data of the preceding operations which can then be forwarded to a faulting or assisting load operation, which can be exploited under certain conditions. Fill buffers are shared between Hyper-Threads so cross thread leakage is possible.”h]”hX/MFBDS leaks Fill Buffer Entries. Fill buffers are used internally to manage L1 miss situations and to hold data which is returned or sent in response to a memory or I/O operation. Fill buffers can forward data to a load operation and also write data to the cache. When the fill buffer is deallocated it can retain the stale data of the preceding operations which can then be forwarded to a faulting or assisting load operation, which can be exploited under certain conditions. Fill buffers are shared between Hyper-Threads so cross thread leakage is possible.”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KhhÙh²hubhë)”}”(hXÓMLPDS leaks Load Port Data. Load ports are used to perform load operations from memory or I/O. The received data is then forwarded to the register file or a subsequent operation. In some implementations the Load Port can contain stale data from a previous operation which can be forwarded to faulting or assisting loads under certain conditions, which again can be exploited eventually. Load ports are shared between Hyper-Threads so cross thread leakage is possible.”h]”hXÓMLPDS leaks Load Port Data. Load ports are used to perform load operations from memory or I/O. The received data is then forwarded to the register file or a subsequent operation. In some implementations the Load Port can contain stale data from a previous operation which can be forwarded to faulting or assisting loads under certain conditions, which again can be exploited eventually. Load ports are shared between Hyper-Threads so cross thread leakage is possible.”…””}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K"hhÙh²hubhë)”}”(hŒøMDSUM is a special case of MSBDS, MFBDS and MLPDS. An uncacheable load from memory that takes a fault or assist can leave data in a microarchitectural structure that may later be observed using one of the same methods used by MSBDS, MFBDS or MLPDS.”h]”hŒøMDSUM is a special case of MSBDS, MFBDS and MLPDS. An uncacheable load from memory that takes a fault or assist can leave data in a microarchitectural structure that may later be observed using one of the same methods used by MSBDS, MFBDS or MLPDS.”…””}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K*hhÙh²hubeh}”(h]”(Œoverview”hØeh ]”h"]”(Œoverview”Œmds”eh$]”h&]”uh1hµhh·h²hh³hÊh´KŒexpect_referenced_by_name”}”j°hÍsŒexpect_referenced_by_id”}”hØhÍsubh¶)”}”(hhh]”(h»)”}”(hŒExposure assumptions”h]”hŒExposure assumptions”…””}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj·h²hh³hÊh´K0ubhë)”}”(hŒºIt is assumed that attack code resides in user space or in a guest with one exception. The rationale behind this assumption is that the code construct needed for exploiting MDS requires:”h]”hŒºIt is assumed that attack code resides in user space or in a guest with one exception. The rationale behind this assumption is that the code construct needed for exploiting MDS requires:”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K2hj·h²hubhû)”}”(hŒû- to control the load to trigger a fault or assist - to have a disclosure gadget which exposes the speculatively accessed data for consumption through a side channel. - to control the pointer through which the disclosure gadget exposes the data ”h]”j)”}”(hhh]”(j)”}”(hŒ1to control the load to trigger a fault or assist ”h]”hë)”}”(hŒ0to control the load to trigger a fault or assist”h]”hŒ0to control the load to trigger a fault or assist”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K6hjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÚubj)”}”(hŒrto have a disclosure gadget which exposes the speculatively accessed data for consumption through a side channel. ”h]”hë)”}”(hŒqto have a disclosure gadget which exposes the speculatively accessed data for consumption through a side channel.”h]”hŒqto have a disclosure gadget which exposes the speculatively accessed data for consumption through a side channel.”…””}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K8hjõubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÚubj)”}”(hŒLto control the pointer through which the disclosure gadget exposes the data ”h]”hë)”}”(hŒKto control the pointer through which the disclosure gadget exposes the data”h]”hŒKto control the pointer through which the disclosure gadget exposes the data”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K;hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÚubeh}”(h]”h ]”h"]”h$]”h&]”jjjkuh1jh³hÊh´K6hjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1húh³hÊh´K6hj·h²hubhë)”}”(hŒThe existence of such a construct in the kernel cannot be excluded with 100% certainty, but the complexity involved makes it extremely unlikely.”h]”hŒThe existence of such a construct in the kernel cannot be excluded with 100% certainty, but the complexity involved makes it extremely unlikely.”…””}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K>hj·h²hubhë)”}”(hŒ¼There is one exception, which is untrusted BPF. The functionality of untrusted BPF is limited, but it needs to be thoroughly investigated whether it can be used to create such a construct.”h]”hŒ¼There is one exception, which is untrusted BPF. The functionality of untrusted BPF is limited, but it needs to be thoroughly investigated whether it can be used to create such a construct.”…””}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KAhj·h²hubeh}”(h]”Œexposure-assumptions”ah ]”h"]”Œexposure assumptions”ah$]”h&]”uh1hµhh·h²hh³hÊh´K0ubh¶)”}”(hhh]”(h»)”}”(hŒMitigation strategy”h]”hŒMitigation strategy”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjUh²hh³hÊh´KGubhë)”}”(hŒŽAll variants have the same mitigation strategy at least for the single CPU thread case (SMT off): Force the CPU to clear the affected buffers.”h]”hŒŽAll variants have the same mitigation strategy at least for the single CPU thread case (SMT off): Force the CPU to clear the affected buffers.”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KIhjUh²hubhë)”}”(hŒÉThis is achieved by using the otherwise unused and obsolete VERW instruction in combination with a microcode update. The microcode clears the affected CPU buffers when the VERW instruction is executed.”h]”hŒÉThis is achieved by using the otherwise unused and obsolete VERW instruction in combination with a microcode update. The microcode clears the affected CPU buffers when the VERW instruction is executed.”…””}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KLhjUh²hubhë)”}”(hX For virtualization there are two ways to achieve CPU buffer clearing. Either the modified VERW instruction or via the L1D Flush command. The latter is issued when L1TF mitigation is enabled so the extra VERW can be avoided. If the CPU is not affected by L1TF then VERW needs to be issued.”h]”hX For virtualization there are two ways to achieve CPU buffer clearing. Either the modified VERW instruction or via the L1D Flush command. The latter is issued when L1TF mitigation is enabled so the extra VERW can be avoided. If the CPU is not affected by L1TF then VERW needs to be issued.”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KPhjUh²hubhë)”}”(hŒÉIf the VERW instruction with the supplied segment selector argument is executed on a CPU without the microcode update there is no side effect other than a small number of pointlessly wasted CPU cycles.”h]”hŒÉIf the VERW instruction with the supplied segment selector argument is executed on a CPU without the microcode update there is no side effect other than a small number of pointlessly wasted CPU cycles.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KVhjUh²hubhë)”}”(hŒ¦This does not protect against cross Hyper-Thread attacks except for MSBDS which is only exploitable cross Hyper-thread when one of the Hyper-Threads enters a C-state.”h]”hŒ¦This does not protect against cross Hyper-Thread attacks except for MSBDS which is only exploitable cross Hyper-thread when one of the Hyper-Threads enters a C-state.”…””}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KZhjUh²hubhë)”}”(hŒ=The kernel provides a function to invoke the buffer clearing:”h]”hŒ=The kernel provides a function to invoke the buffer clearing:”…””}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K^hjUh²hubhû)”}”(hŒx86_clear_cpu_buffers() ”h]”hë)”}”(hŒx86_clear_cpu_buffers()”h]”hŒx86_clear_cpu_buffers()”…””}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´K`hjºubah}”(h]”h ]”h"]”h$]”h&]”uh1húh³hÊh´K`hjUh²hubhë)”}”(hŒŠAlso macro CLEAR_CPU_BUFFERS can be used in ASM late in exit-to-user path. Other than CFLAGS.ZF, this macro doesn't clobber any registers.”h]”hŒŒAlso macro CLEAR_CPU_BUFFERS can be used in ASM late in exit-to-user path. Other than CFLAGS.ZF, this macro doesn’t clobber any registers.”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KbhjUh²hubhë)”}”(hŒ_The mitigation is invoked on kernel/userspace, hypervisor/guest and C-state (idle) transitions.”h]”hŒ_The mitigation is invoked on kernel/userspace, hypervisor/guest and C-state (idle) transitions.”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KehjUh²hubhë)”}”(hX,As a special quirk to address virtualization scenarios where the host has the microcode updated, but the hypervisor does not (yet) expose the MD_CLEAR CPUID bit to guests, the kernel issues the VERW instruction in the hope that it might actually clear the buffers. The state is reflected accordingly.”h]”hX,As a special quirk to address virtualization scenarios where the host has the microcode updated, but the hypervisor does not (yet) expose the MD_CLEAR CPUID bit to guests, the kernel issues the VERW instruction in the hope that it might actually clear the buffers. The state is reflected accordingly.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KhhjUh²hubhë)”}”(hŒ÷According to current knowledge additional mitigations inside the kernel itself are not required because the necessary gadgets to expose the leaked data cannot be controlled in a way which allows exploitation from malicious user space or VM guests.”h]”hŒ÷According to current knowledge additional mitigations inside the kernel itself are not required because the necessary gadgets to expose the leaked data cannot be controlled in a way which allows exploitation from malicious user space or VM guests.”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hêh³hÊh´KnhjUh²hubeh}”(h]”Œmitigation-strategy”ah ]”h"]”Œmitigation strategy”ah$]”h&]”uh1hµhh·h²hh³hÊh´KGubh¶)”}”(hhh]”(h»)”}”(hŒ Kernel internal mitigation modes”h]”hŒ Kernel internal mitigation modes”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´Ktubhû)”}”(hXœ======= ============================================================ off Mitigation is disabled. Either the CPU is not affected or mds=off is supplied on the kernel command line full Mitigation is enabled. CPU is affected and MD_CLEAR is advertised in CPUID. vmwerv Mitigation is enabled. CPU is affected and MD_CLEAR is not advertised in CPUID. That is mainly for virtualization scenarios where the host has the updated microcode but the hypervisor does not expose MD_CLEAR in CPUID. It's a best effort approach without guarantee. ======= ============================================================ ”h]”hŒtable”“”)”}”(hhh]”hŒtgroup”“”)”}”(hhh]”(hŒcolspec”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j1hj.ubj2)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K