The Ken Thompson Hack
wiki.c2.com
wiki.c2.com
I've spent a lot of my spare time the past year or so working on my own attempt at a portable bootstrappable compiler. It's partly to prevent this attack, and also partly so that future archaeologists can easily bootstrap C even if their computer architectures can't run any binaries from the present day.
https://github.com/ludocode/onramp
It's nowhere near done but I'm starting a new job soon so I felt like I needed to publish what I have. It does at least bootstrap from handwritten x86_64 machine code up to a compiler for most of C89, and I'm working on the final stage that will hopefully be able to compile TinyCC and other similar C compilers soon.
What if the trojan is in microcode? No amount of bootstrap in freestanding can protect you here.
These are all genuine attack vectors but they are not really solvable from the software side. At least for Onramp I consider these problems to be out of scope. It may be possible to solve these with open hardware but a solution will look very different from the kind of software bootstrapping we're doing.
Maybe on two completely different ones and verify for differences.
It's such a well-written article.
Here's previous HN discussion about it:
Running the "Reflections on Trusting Trust" Compiler - https://news.ycombinator.com/item?id=38020792 - Oct 2023 (67 comments)
(posted by rsc himself!)
>"This site uses features not available in older browsers."
>Enable Javascript.
Black plaintext on white background with hyperlinks. Revolutionary.
In particular, it could be one you wrote yourself. It doesn't need to support everything, just enough to compile the compiler under test.
It could also be a compiler from a different group/organization.
You could use many compilers and test with all them.
> Acknowledgment. I first read of the possibility of such a Trojan horse in an Air Force critique [4] of the security of an early implementation of Multics. I cannot find a more specific reference to this document. I would appreciate it if anyone who can supply this reference would let me know.
ofc the US Gov was behind this. Incredible.
How many supply-chain generated backdoors in the wild today?
So yes, they're scary, but there are countermeasures.
Generally in these environments you build with optimizations off unless needed to ease this validation process as, obviously, you must validate the released/deployed version.
just is doing a lot of work there.
[1] the monsters normally known as "browsers", witch happen to be something like `less`, `more`, `most` and so on, not much like a JVM "javascript required to view this site" while perfectly classic looking and modern looking websites works very well without js, if you enable js but keep third party contents restricted you get a "page does not exist"...
A critics just to say "please, if your audience is some tech savvy cohort, try to design things for them.
Text documents? Word documents? CSV files? Excel files? Cat videos? Porn videos? Source code from a trusted source? Source code from randos? Games or apps installed from a marketplace? Games or apps installed as downloads directly from random websites?
It's like asking what's the chance you'll die from a fall if you live 80 years. The chance is hard to know, but it's probably more likely if you're a free solo rock climber than if you aren't.
Not to mention hardware backdoors in chips. Have all trillions of transistors and their schematics in each chip version been checked for possible backdoors in the Verilog compiler? One extra connection can provide root access and cost millions of dollars.
Could you elaborate? The TCB did not increase since almost the beginning of Qubes. Moreover, the hardware-assisted virtualization by default improved the security a lot. Also, Qubes is not a Linux distribution: https://www.qubes-os.org/faq/#is-qubes-just-another-linux-di...
https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-...
This gives the level of auditability and transparency that we desperately need.
However, the same problem of "yogurt software" manifests at higher levels of the stack, typically with compilers and build systems, some of which still cannot be built from source (GHC and Bazel come to mind).