lainchan / sec
C Compiler Backdoors
Hououin Kyouma · 2020-09-21 17:34
If backdoors in C Compilers like GCC, LLVM/Clang, and whatever other compilers exist and can add in backdoors to programs that are compiled with the compromised C compiler, how can the backdoors be mitigated?
Mitnick · 2020-09-21 18:20
https://dwheeler.com/trusting-trust/
https://guix.gnu.org/en/blog/2015/reproducible-builds-a-means-to-an-end/
The issue is currently being worked on.
XERXES · 2020-09-21 18:21
>>12418
Continued
https://guix.gnu.org/blog/2019/guix-reduces-bootstrap-seed-by-50/
This explicitly mentions the issue of compiler backdoors.
Leto Atreides I · 2020-09-24 02:17
>>12417
Learn assembly, there is no way to be 100% sure that a compiler isn't backdoored other than actually reading all the instruction line by line, even so hardware can be backdoored so there is really no escape other than having the knowledge to detect even the most cryptic methods of them
Donna Hawthorne · 2020-09-24 10:57
>>12417
>>12442
This.
Honestly just boot up the ELF binary in Ghidra/IDA/Whatever and analyse the assembly.
With Ghidra, you basically don't even have to know assembly due to the decompiling function
Armitage · 2020-09-25 01:23
>>12448
That ignores the bootstrapping problem entirely.
There's no reasons those copies of the tools aren't also compromised.
Though solving the bootstrap problem does require knowing assembly as well.
Acid Burn · 2020-09-26 02:29
>>12462
but what if hexdump is compromised??
Motoko Kusanagi · 2020-09-26 10:36
Read the source bitewise in a random manner. Then do a translation into a pseudolanguage using the bits for a decision tree without ever assembling the bytesequence directly and work on that. Should successfully escape any pattern recognition masking malware code from the viewer.
Dujour · 2020-09-26 15:43
>>12480
after only fifteen years of hard work, you can finally verify that your pong game doesn't have a backdoor.
Ivan Petrov · 2020-09-28 06:05
>>12462
What are you even going on about with hexdump?
The end-goal is for the initial bootstrap seed to either be coded in assembler or directly in machine code, so you can bootstrap a minimal scheme interpreter with which you then bootstrap everything else from source.
Nameless · 2020-09-28 06:12
>>12508
I meant >>12478
Crash Override · 2020-10-01 16:14
Can't you just use gcc to produce NASM. Use a tool like this to convert it to some old as dirt binary only assembler like TASM
http://www.devoresoftware.com/nomyso/
Because TASM is so old and was only distributed in binary format it's been poured over by curious, bored, and frustrated assembly programmers across the 20 so years of it's popularity.
If your sample makes it to tasm cleanly then you can compile a whole compiler in gcc and convert it to tasm and then use that to compile gcc.
If I put a backdoor in a c compiler I'd be skittish about including it in assembly outputs if such a thing occurred to me.
Tyrell Wellick · 2020-10-01 16:38
>>12556
So, first off that site supports no transport security and provides no signatures nor safely-transported hashes to verify the output, which means it's unreliable at best.
But in any case, relying on a magical blob no one can really reproduce is not an acceptable option as it limits legally-valid scrutiny (due to a bunch of countries being retarded).
It's far easier to reduce the binary seed & properly solve the issue than to get countries to stop being retarded.
Cat Mother · 2020-10-01 19:09
>>12484
Time wouldn't be a problem, you could parallelize IO and make it as fast as you want. The more fundamental issue is if the idea of simply reading on a sub-instruction scale even works.
They could for example use a signature sequence to insert malware code during execution. Digging through the file even manually wouldn't work in that case. This could be furthermore even in hardware. It's pretty unrealistic to win a max paranoia scenario.