My problem with understanding here is that the retpoline technique does not appear to require any new instruction (i.e. it should not require a microcode upgrade). Does gcc use another (preferable?) technique by requiring the new instruction (microcode upgrade)?Naib wrote:You need GCC update as well and that has only just been committed to gcc8
Thanks for the clarification. So do I understand correctly that the gcc patch is against both, #1 and #2, one using retpoline and the other using the new instruction?Naib wrote:That's because there are two variants of spectre
pjp wrote:But the underlying issue is still whether or not AMD should have it enabled. From the prior information, the answer appears to be yes.PrSo wrote:So it seems that even if you compile kernel with CONFIG_PAGE_TABLE_ISOLATION=Y PTI is auto-disabled on AMD cpu anyway.pjp wrote: That sounds to me like CONFIG_PAGE_TABLE_ISOLATION should be enabled for AMD processors. Or at least not setting it with the knowledge of leaving the vulnerability exposed.
To enable the functionality, I had to enable the kernel option AND enable it on the kernel command line with "pti=on". After that (and only after that):(I got the idea from Naib's post on page 5 of this thread which referenced "pti=off". Thanks Naib!)Code: Select all
dmesg |grep -i isol [ 0.000000] Kernel/User page tables isolation: force enabled on command line. [ 0.000000] Kernel/User page tables isolation: enabled
Thomas Lendacky wrote: AMD processors are not subject to the types of attacks that the kernel page table isolation feature protects against.
That PoC is for spectre #1, the new microcode is for mitigating spectre #2.mv wrote:Versions for my cpu have been updated, but (unsurprisingly) https://github.com/Eugnis/spectre-attack still renders the machine as exploitable (though I didn't check whether it tests spectre #1 or #2).
None of these vulnerabilities can be fixed with microcode updates alone. If they could Intel and AMD would have done so. Spectre #2 can be mitigated by the new functionality the microcode introduce if the operating system use that functionality. This requires both the microcode and updates to the kernel.mv wrote:("unsurprisingly", because it was announced somewhere that these 2 cannot be fixed by microcode).
Yes... well it's mitigated by pti.mv wrote:And meltdown (i.e. #3) is fixed by pti in the kernel, isn't it?
No, the compiler patches (retpoline support) is independent of the microcode. If a program is compiled with retpolines an evil program can't use spectre #2 to read that program's memory. So if the kernel is compiled with retpolines regular programs can't read the kernel memory, but they can still read each others memory and BIOS/UEFI memory. If all programs and the kernel are compiled with retpolines an evil program could only read BIOS/UEFI memory but that's bad enough. There might also be closed source programs that can't be recompiled. The microcode makes it possible for the kernel to flush the state of the branch predictor on context switches so that evil programs can't influence speculative execution of other programs. That is needed to protect the BIOS and closed source programs but it has higher overhead than just retpolines. Retpolines also don't work at all on recent Intel cpus like Skylake so the microcode update is a must there. At least that is how I understand it.mv wrote:Somewhere it was announced that the microcode updates are necessary to make the upcoming compiler patches work
https://forums.gentoo.org/viewtopic-p-8 ... ml#8167514mv wrote:(and also how to check whether my updated version really contains the "mitigations" whatever they are, e.g. whether the new instruction has been added...)
Graz University of Technology is not exactly a "random" source. Look at code or have someone who can, it does not do anything beyond what's documented . This was my point with those other projects, why trust? and root is required to make it easier. you can just plug in the KASLR offset yourself and attack your own software and never use root.pjp wrote:What makes random C code on github which requires root access trustworthy?Naib wrote:Exactly...blopsalot wrote:This project is the only PoC/test I found that's not garbage.
https://github.com/IAIK/meltdown
Part of me groaned when that "checker" was being used around this place... it just checks the main mitigations are in-place. This in itself is a good check BUT if you really want to be sure you need to run the PoC code
Well, isn't one of the primary warnings to not run untrustworthy code?kajzer wrote:But to write a PoC and need that.... maybe I got things wrong but I thought the whole point of this exploits/bugs is that you can read kernel memory from userland, reading it from root ... I don't see a point.
Code: Select all
CONFIG_RETPOLINE=y
CONFIG_PAGE_TABLE_ISOLATION=yCode: Select all
pti=<value>
nopti
spectre_v2=<value>
nospectre_v2
Code: Select all
/sys/devices/system/cpu/vulnerabilities/meltdown
/sys/devices/system/cpu/vulnerabilities/spectre_v1
/sys/devices/system/cpu/vulnerabilities/spectre_v2
Code: Select all
# dmesg | egrep "(isolation|Spectre)"
[ 0.000000] Kernel/User page tables isolation: enabled
[ 0.011967] Spectre V2 mitigation: Vulnerable: Minimal generic ASM retpoline
# cd /sys/devices/system/cpu/vulnerabilities/*
# for file in *; do echo "$file : $(tail -n1 $file)"; done
meltdown : Mitigation: PTI
spectre_v1 : Vulnerable
spectre_v2 : Vulnerable: Minimal generic ASM retpoline
Code: Select all
[root@jenkins vulnerabilities]# pwd
/sys/devices/system/cpu/vulnerabilities
[root@jenkins vulnerabilities]# ls -l
total 0
-r--r--r--. 1 root root 4096 Jan 15 18:53 meltdown
-r--r--r--. 1 root root 4096 Jan 15 18:53 spectre_v1
-r--r--r--. 1 root root 4096 Jan 15 18:53 spectre_v2
[root@jenkins vulnerabilities]# cat *
Mitigation: PTI
Vulnerable
Vulnerable: Minimal generic ASM retpolineCode: Select all
[root@jenkins vulnerabilities]# uname -r
4.14.13-300.fc27.x86_64
Yes, Fedora and RHEL seem to be ahead. I already saw it here.Hossie wrote:That doesn't seem to be "new", this is how a fedora kernel already looks like:
I plan to do GCC 7.3 RC1 on Wednesday now with the final release about a week later if no issue shows up.
So we all have to go ~arch on GCC?mike155 wrote:It seems that GCC 7.3 with Spectre mitigation patches will be released soon. Richard Biener wrote:I plan to do GCC 7.3 RC1 on Wednesday now with the final release about a week later if no issue shows up.

why not? you have been running a 9999 CPU for the last couple of decadesNeddySeagoon wrote:Hossie,
How lucky do you feel?
The patches are there now.
Personally, I don't feel confidenh enough to run a -9999 gcc.

Did you also switch to profile 17?ian.au wrote:My reqular emerge installed 6.4.0 on Sunday, other than having to process a bunch of preserved rebuilds I wouldn't have noticed.mno wrote:I did 4.9.4 to 6.4.0 and that went generally well.
Edit to say: so for that reason alone, I'd just do the interim step on non-exotic systems.