brintos

brintos / linux-shallow public Read only

0
0
Text · 5.0 KiB · 264bfa9 Raw
110 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3GDS - Gather Data Sampling4==========================5 6Gather Data Sampling is a hardware vulnerability which allows unprivileged7speculative access to data which was previously stored in vector registers.8 9Problem10-------11When a gather instruction performs loads from memory, different data elements12are merged into the destination vector register. However, when a gather13instruction that is transiently executed encounters a fault, stale data from14architectural or internal vector registers may get transiently forwarded to the15destination vector register instead. This will allow a malicious attacker to16infer stale data using typical side channel techniques like cache timing17attacks. GDS is a purely sampling-based attack.18 19The attacker uses gather instructions to infer the stale vector register data.20The victim does not need to do anything special other than use the vector21registers. The victim does not need to use gather instructions to be22vulnerable.23 24Because the buffers are shared between Hyper-Threads cross Hyper-Thread attacks25are possible.26 27Attack scenarios28----------------29Without mitigation, GDS can infer stale data across virtually all30permission boundaries:31 32	Non-enclaves can infer SGX enclave data33	Userspace can infer kernel data34	Guests can infer data from hosts35	Guest can infer guest from other guests36	Users can infer data from other users37 38Because of this, it is important to ensure that the mitigation stays enabled in39lower-privilege contexts like guests and when running outside SGX enclaves.40 41The hardware enforces the mitigation for SGX. Likewise, VMMs should  ensure42that guests are not allowed to disable the GDS mitigation. If a host erred and43allowed this, a guest could theoretically disable GDS mitigation, mount an44attack, and re-enable it.45 46Mitigation mechanism47--------------------48This issue is mitigated in microcode. The microcode defines the following new49bits:50 51 ================================   ===   ============================52 IA32_ARCH_CAPABILITIES[GDS_CTRL]   R/O   Enumerates GDS vulnerability53                                          and mitigation support.54 IA32_ARCH_CAPABILITIES[GDS_NO]     R/O   Processor is not vulnerable.55 IA32_MCU_OPT_CTRL[GDS_MITG_DIS]    R/W   Disables the mitigation56                                          0 by default.57 IA32_MCU_OPT_CTRL[GDS_MITG_LOCK]   R/W   Locks GDS_MITG_DIS=0. Writes58                                          to GDS_MITG_DIS are ignored59                                          Can't be cleared once set.60 ================================   ===   ============================61 62GDS can also be mitigated on systems that don't have updated microcode by63disabling AVX. This can be done by setting gather_data_sampling="force" or64"clearcpuid=avx" on the kernel command-line.65 66If used, these options will disable AVX use by turning off XSAVE YMM support.67However, the processor will still enumerate AVX support.  Userspace that68does not follow proper AVX enumeration to check both AVX *and* XSAVE YMM69support will break.70 71Mitigation control on the kernel command line72---------------------------------------------73The mitigation can be disabled by setting "gather_data_sampling=off" or74"mitigations=off" on the kernel command line. Not specifying either will default75to the mitigation being enabled. Specifying "gather_data_sampling=force" will76use the microcode mitigation when available or disable AVX on affected systems77where the microcode hasn't been updated to include the mitigation.78 79GDS System Information80------------------------81The kernel provides vulnerability status information through sysfs. For82GDS this can be accessed by the following sysfs file:83 84/sys/devices/system/cpu/vulnerabilities/gather_data_sampling85 86The possible values contained in this file are:87 88 ============================== =============================================89 Not affected                   Processor not vulnerable.90 Vulnerable                     Processor vulnerable and mitigation disabled.91 Vulnerable: No microcode       Processor vulnerable and microcode is missing92                                mitigation.93 Mitigation: AVX disabled,94 no microcode                   Processor is vulnerable and microcode is missing95                                mitigation. AVX disabled as mitigation.96 Mitigation: Microcode          Processor is vulnerable and mitigation is in97                                effect.98 Mitigation: Microcode (locked) Processor is vulnerable and mitigation is in99                                effect and cannot be disabled.100 Unknown: Dependent on101 hypervisor status              Running on a virtual guest processor that is102                                affected but with no way to know if host103                                processor is mitigated or vulnerable.104 ============================== =============================================105 106GDS Default mitigation107----------------------108The updated microcode will enable the mitigation by default. The kernel's109default action is to leave the mitigation enabled.110