Home > Uncategorized > Compiler writing: The career path to World domination

Compiler writing: The career path to World domination

November 7th, 2009 Derek-Jones

Compiler writing is not usually thought of as a career path that leads to becoming Ruler of the World. Perhaps this is because compiler writing is a relatively new profession and us compiler writers are still toiling in obscurity awaiting the new dawn.

What might be a workable plan for a compiler writer to become Ruler of the World? One possibility is to write a compiler for the language in which most of the World’s critical software is written (i.e., C) and for that compiler to become the one that the vendors of this critical software all use (i.e., gcc). This compiler needs to do more that just compile the source code it is feed, it also needs to generate code that creates a backdoor in important programs (e.g., the login program).

But, you say, this cannot happen with gcc because its source is available for everybody to read (and spot any backdoor generator). In his 1984 Turing acceptance lecture Ken Thompson showed how a compiler could contain a backdoor that was not visible in its source. The idea is for the compiler writer to modify a compiler to detect when it is being used to compile itself and to insert the backdoor generating code into its own executable. This modified compiler is then used to compile itself and the resulting executable made the default compiler; the backdoor modifications are then removed from the compiler source, they are no longer needed because the previously compiled compiler will spot when it is being used to compile its own source and generate the code necessary to propagate the backdoor code into the executable it creates.

How would the world counter the appearance of such a modified gcc? Obviously critical programs would need to be recompiled by a version of gcc that did not contain the backdoor. Today there are several companies and many amateur groups that distribute their own Linux distributions which they build from source. It should be relatively easy to obtain a usable executable of gcc from 10 years ago; remember what is needed is a version capable of compiling the latest gcc sources.

The ideal time to create a backdoor’ed version of gcc is while its development was under the control of one person, so early in the development history that all versions available anywhere are very likely to be derived from it. How can we prove that the original author of gcc did not do just this?

It could be argued that the very substantial changes to the gcc sources (most of the source has probably been rewritten several times) mean that the coding patterns searched for by the executable to detect that it is compiling itself have long gone and at some point the backdoor failed to propagate itself to the next executable.

Compilers other than gcc might also include backdoors that propagate themselves. However, the method of propagation is likely to be different. Compiling the gcc sources with a non-gcc compiler creates an executable that should exhibit the same behavior as a gcc-compiled executable. Differences in the behavior of these independently built executables is a cause for concern (one difference might be caused by differences in the conversion of floating-point literals, a recent PhD thesis provides more detail).

The problem with compiling the gcc sources is that they make use of language extensions that few, if any, other compilers support. I know IBM added modified one of their C compilers to support those gcc extensions needed to compile the Linux kernel, but I don’t know if this compiler is capable of compiling the gcc sources. The LLVM project intended to support many gcc extensions but I don’t know if they aim to be able to compile the gcc sources.

Another option is to compare the assembler generated when gcc compiles itself against the corresponding source code. A very expensive task for source code measured in hundreds of thousands of lines. Adding the necessary language extension support to another compiler would probably be cheaper and also create a tool that could be used to check future releases of gcc.

  1. November 17th, 2009 at 21:27 | #1

    This thesis is relevant: Fully countering \Trusting Trust\ by diverse double-compiling.

    http://www.dwheeler.com/blog/2009/11/02/#trusting-trust-dissertation

  2. November 18th, 2009 at 02:23 | #2

    David Wheeler’s thesis blog post is linked to through “a recent PhD thesis”. I was a bit disappointed that this thesis wasted so much space on mathematical proofs of little practical relevance and less space on realistic verification issues.

    I don’t think it is realistic to assume the existence of a trusted compiler. We should assume that all compilers contain backdoors.

    Analysing in more detail how actual implementations might function would provide data that could be used to estimate the probability that two independently developed compilers would use the same backdoor techniques and thus make it lot less likely that one could be used to verify the other (making the worse case scenario that all compilers contain backdoors). It could also provide useful insight into how source code evolution impacts backdoor propagation success rates.

  3. yugr
    December 25th, 2009 at 21:38 | #3

    Well, CIA or NSA (or their equivalents in other countries) may invest a few man-years to build a very basic compiler just for a purpose of gcc validation.

  1. No trackbacks yet.
Comments are closed.
www.wenn.com
FireStats icon Powered by FireStatswww.tinynibbles.com buy cialis online uk

cialis next day

lowest propecia prices

how much does cialis cost

cialis fast delivery usa

canada online pharmacy levitra

cialis no prescription

cialis cheap us pharmacy

canadian pharmacy cialis

once daily cialis

cialis prescription

buy cialis 5 mg

canada levitra

brand name cialis

cheap propecia online prescription

cialis and canada custom

daily dosage cialis

cialis 50 mg

best price levitra

buy can from i propecia who

cialis professional 100 mg

lowest propecia prices in canada

order cheap levitra

buy generic viagra india rx

generic cialis next day shipping

order generic levitra

buy viagra china

discount propecia rx

cialis price

buy fast propecia

generic levitra online

getting cialis from canada

buy cialis usa

get levitra online

buy propecia prescriptions online

cheap levitra without prescription

levitra online overnight delivery

buy cialis in usa

best price cialis

buying propecia

buy cheap levitra

discount levitra rx

order propecia

canada viagra pharmacies scam

cialis in mexico

levitra cheap fast

for sale levitra

generic cialis soft tabs

canadian healthcare viagra

buy cialis for daily use

levitra online no prescription

cheapest propecia sale uk

get cialis

generic propecia effective

generic viagra made in usa

cialis strenght mg

buy levitra online viagra

levitra in india

levitra canadian

cheap fast levitra

buy cialis cannada

overnight delivery cialis

generic viagra canada

brand viagra professional

name brand cialis

cheapest viagra usa

cialis 100 mg generic

cialis pharmacy

levitra low price

order cheapest propecia online

cialis cheap

how to get viagra

cheap propecia uk

bestellen levitra online

cialis refractory

best viagra

levitra for sale

cheap levitra uk

how to buy cialis in canada

levitra next day delivery

generic cialis sale

order cheap propecia

online propecia uk

generic viagra online

buy viagra online

internet pharmacy propecia

buy cialis without prescription

buying cialis

low cost levitra

buy cheap levitra online

cialis soft pills

levitra 10mg

cialis and diarrhea

cost of propecia

indian viagra

canadian pharmacy viagra

canada viagra

cialis overnight

levitra buy online

online propecia prescription

buy cialis online canada

cialis daily

cialis by mail

cialis purchase

buy levitra online no prescription

cheap levitra prescription

cialis daily dosage pharmacy

cialis price in canada

online viagra gel to buy

buy levitra overnight

cheap levitra tablets

female viagra pills

cialis generic 100 mg

next day viagra

lowest propecia 1 mg

canadian viagra india

buy generic cialis

buy propecia on line

cheap propecia online

canadian pharmacy discount code viagra

discount us propecia

canadian healthcare pharmacy

generic propecia finasteride

levitra mg

generic cialis from india

ganeric cialis

discount propecia online

cheap canadian viagra

cialis woman

online ordering propecia

cheap order prescription propecia

online generic cialis 100 mg

order prescription propecia

lowest price on non generic levitra

cheap viagra canada or india

buy propecia canada

buy real viagra online

can i get viagra in mexico

cialis one a day

buying levitra online

buy generic levitra

buy cialis once daily

buying generic propecia

cheap discount levitra

cialis delivered overnight

levitra discount

buy propecia cheap

cheap prescription propecia

buying generic cialis mexico rx

generic viagra made in india

generic propecia 5mg

canada viagra generic

cialis online

generic viagra india

buy prescription propecia without

discount cialis india

cialis fast delivery

get cialis online

levitra viagra cialis

canada propecia prescription

cialis 5 mg buy

cialis 5 mg italia

get levitra

buy propecia now

cialis professional 20 mg

buy levitra online from canada

buying cialis soft tabs 100 mg

generic viagra 100 mg

buy propecia online from usa pharmacy

next day delivery cialis

cheapest viagra

levitra in canada

generic levitra canada

buy viagra on line

obtain viagra without prescription

generic levitra purchase

generic viagra canadian

cheapest prices for viagra

canada cheap propecia

mail online order propecia

generic propecia online pharmacy

cialis discount

cialis 100 mg

how to get cialis in canada

cialis to buy

lowest cost levitra

buy cialis canada

hydrochlorothiazide cialis

buy viagra

buy cheap generic levitra

buying viagra in canada

levitra from canadian pharmacy

cialis 20 mg

buy cialis fedex shipping

buy now propecia

canadian healthcare

best way to use cialis

mexico levitra

levitra sales uk

healthcare canadian pharmacy

buy cheapest propecia

lowest price for propecia

buy levitra us

online cheap viagra

buy propecia without prescription

canadian pharmacies cialis

how strong is 5 mg of cialis

canada meds viagra

order viagra or levitra

cheapest overnight cialis

online pharmacy propecia renova

best price for propecia

buy viagra without prescription

i need to buy propecia

fda levitra

cialis uk

overnight delivery viagra

buy discount viagra

buy propecia where

cost of daily cialis

cialis buy overnight

cialis on women

generic levitra vardenafil

mail order propecia

buy propecia online

lowest price propecia

cialis quick shipment

buy 5 mg cialis

generic propecia sale

order levitra online

best price generic propecia

generic propecia for sale

online propecia prescriptions

ordering cialis gel

cialis tablets foreign

online pharmacy propecia viagra

buy branded viagra

low price levitra

cialis overnight delivery

best price for generic cialis

buy propecia online prescription

lowest priced propecia

discount propecia propecia

buy propecia online pharmacy

levitra prescription

cialis 5 mg

canada online pharmacy propecia

buy levitra vardenafil

get propecia online pharmacy

gele viagra

lowest price propecia best

best price propecia

ordering propecia online

buy propecia generic

how much is viagra

levitra tabs

china viagra

does generic cialis work

5 mg original brand cialis

cialis profesional

lowest price levitra

mexico pharmacy cialis

generic propecia alternative

mail order levitra

cheapest viagra online

canadian drugs propecia

generic propecia fda approved

online levitra

cheap propecia 5mg

cheapest propecia prescription

cialis vs levitra

buying propecia online

drug generic propecia

canadian online pharmacy cialis

cheap cialis from india

cialis professional no prescription

cialis transdermal

50 mg cialis

cialis from canada

low cost canadian viagra

cialis from mexico

buy generic propecia

how much cialis

buy viagra mexico

buy canada levitra

canadian viagra 50mg

combine cialis and levitra

cost levitra low

levitra online sales

levitra mail order

buy online prescription propecia

cheap propecia no prescription

brand viagra over the net

cialis tablets

cheap cialis soft

indian cialis generic

levitra online

brand cialis for sale

buy propecia in the uk

herbal propecia