tholin wrote:alex-kas wrote:Can anyone explain me why should someone think about recompiling something more than a kernel??? I mean to defend from Specter. I was thinking that having kernel compiled with the retpoline switches I kinda guarantee this kernel will help me protecting my box. Am I wrong?
Compiling the kernel with retpolines will protect the kernel but only the kernel. Applications could still read each others memory but not the kernels memory. Recompiling everything will protect everything (except the firmware so you still need the microcode fix).
alex-kas wrote:Also, as tholin wrote in the previous post, devs try or at least think to implement ELF changes which would be used by the kernel in order to speedup things IF the program with such an ELF has a bit indicating the retpoline protection switches were used. Is it a joke? I will compile my binary my way and then put whatever bit you want

And the kernel would blindly think it is a wise and proper app???
The new bit would be use to tell the kernel that a program is protected by itself (with retpolines) so that the kernel doesn't have to protect it (using the new microcode functionality). You could compile a program without retpolines and set the bit. Then your program could be attacked by other program but in that case you have yourself to blame. The bit is only used to say a program i immune to attack, it says nothing about how trustworthy a program is.
alex-kas wrote:So, back to the question: what is the background for aiming to the whole box re-compilation? And, if yes, how to do the same with external/binary packages??? And if yes, recompile and yes, no control of binary packages then how to protect if these are malicious intruders???
Binary packages without retpolines would have to be protected my the kernel using using the new microcode functionality. This has nothing to do with binary packages being evil.
Well, I'm following this whole story since Jan 3 and everything has been very exciting and dynamic and etc... but to sum it up, especially regarding the fixes, I admit that I did not quite understand anything, hehe... .
Therefore, the questions posted by alex-kas kind of mirror my own ones.
I think that I do understand quite well the part involving the kernel being protected (by using retpolines, Kpti, whatever... AND the firware of case of Intel CPUs) => the kernel is protected no-matter-what, and that's it, right?!
But I still do not understand basically "everything else":
1)
The new bit would be use to tell the kernel that a program is protected by itself (with retpolines) so that the kernel doesn't have to protect it (using the new microcode functionality)
The kernel would therefore "speculate" (hehe) that the program hasn't been corrupted? Meaning that if I'm a great cracker and I find out that I can (re/over)write program X on my target's server I'll just flip the bit and I'll have access to everything (not related to the kernel)?
2)
Binary packages without retpolines would have to be protected my the kernel using using the new microcode functionality. This has nothing to do with binary packages being evil.
Basically same thing as #1, but let's say that somebody flips the retpoline-bit in a binary package (being nVidia drivers, Teamviewer, Chrome, etc...) => then just because of "THAT ONE PACKAGE" the whole environment would potentially be back to stoneage (if anyone uses that SW to find a flaw in the environment being OS or other apps), or not?
1+2)
Ok, summarized, I'm basically asking the following:
in a best-case-scenario, are we back to stoneage every-single-time that an attacker manages to introduce and execute on a host ANY ((pre)compiled) code that has the retpoline-flag switched on (as fake) which in turn woud exploit the meltdown/spectre analysis to gather critical info about the running kernel/programs (to then of course access through "normal" app and/or kernel bugs to then gain control of the target device)?
Thaaaaaaks a lot!
Edit: added some details 3 minutes later