Live data from Hacker News

The Ken Thompson Hack

wiki.c2.com

31–40 of 46 posts

Re: The Ken Thompson Hack

#31
post #30

What's the potential percentage of malware on 100GB (100,000,000,000 bytes) in your system if a backdoor occupies 100 bytes?

100GB of what?

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.

Re: The Ken Thompson Hack

#32
post #5

The team at bootstrappable.org have been working very hard at creating compilers that can bootstrap from scratch to prevent this kind of attack (the "trusting trust" attack is another name for it.) They've gotten to the point where they can bootstrap in freestanding so they don't need to trust any OS binaries anymore (see builder-hex0.) I've spent a lot of my spare time the past year or so working on my own attempt a…

Correct me if I’m wrong, but isn’t this recreating a thing that used to exist? I have memories of being told of a compiler older than GCC that could compile itself using… I want to say a bash script. It took forever to run because you had to run the script which of course was slow, and then it output a completely unoptimized compiler. And if memory serves that output didn’t have any of the optimization logic in it. So you had to compile it again to get the optimizer passes to be compiled in, then compile it again to get a fast compiler (self optimization).

Re: The Ken Thompson Hack

#33
post #24

From the ACM paper [0]: > 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. [0]: https://dl.acm.org/doi/pdf/10.1145/358198.358210

I'm not sure it is fair to claim that the Gov is behind the white paper, in that paying for a study is different than a program to develop malicious code.

Re: The Ken Thompson Hack

#34
post #31
post #30

What's the potential percentage of malware on 100GB (100,000,000,000 bytes) in your system if a backdoor occupies 100 bytes?

100GB of what ? 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 f…

Sure modern Mac/Windows/Linux system files with browser cache. Code+data files after build. This is enough to never find out about those 100 bytes.

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.

Re: The Ken Thompson Hack

#36
post #30

What's the potential percentage of malware on 100GB (100,000,000,000 bytes) in your system if a backdoor occupies 100 bytes?

Not all data on your PC are equally dangerous. The key is to keep Trusted Computing Base as small as possible. See: Qubes OS.

Re: The Ken Thompson Hack

#37
post #30

What's the potential percentage of malware on 100GB (100,000,000,000 bytes) in your system if a backdoor occupies 100 bytes?

Not all data on your PC are equally dangerous. The key is to keep Trusted Computing Base as small as possible. See: Qubes OS.

QubesOS is amazing! I've been working on QubesOS for several years. When it was just starting out, it was a fairly simple solution, but now it's a big software, and it has just as many problems as any Linux distribution. Complexity is the only parameter by which you can determine the amount of malware. For 0 bytes of useful code, there will be 0 backdoors. I also developed ACPU OS for this reason 12 years ago, but later realized that no one would pay for simplicity.

Re: The Ken Thompson Hack

#39

Surprisingly, it took until last year for someone to actually ask Ken for the code: https://research.swtch.com/nih

Thanks for the link. I had saved it for later reading, but didn't get around to doing it until now. It's such a well-written article. Here's previous HN discussion about it: https://news.ycombinator.com/item?id=38020792

Thanks! Macroexpanded:

Running the "Reflections on Trusting Trust" Compiler - https://news.ycombinator.com/item?id=38020792 - Oct 2023 (67 comments)

(posted by rsc himself!)

Re: The Ken Thompson Hack

#40

There is something nightmarish about this kind of exploit, and that is maybe why we've been collectively in denial for such a long time. How many supply-chain generated backdoors in the wild today?

One of my favorite short stories plays on the natural horror of this realization: https://www.teamten.com/lawrence/writings/coding-machines/

Thank you! I was immediately reminded of that story when I read the article, but would never have been able to find it!
Post reply on HN