Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

boring C compiler

Name: Anonymous 2015-12-21 20:22

https://groups.google.com/forum/m/#!topic/boring-crypto/48qa1kWignU

this site requires javascript to view.. it's a fucking plain text message.. anyway:

14:40 D. J. Bernstein
As a boring platform for the portable parts of boring crypto software,
I'd like to see a free C compiler that clearly defines, and permanently
commits to, carefully designed semantics for everything that's labeled
"undefined" or "unspecified" or "implementation-defined" in the C
"standard". This compiler will provide a comprehensible foundation for
people writing C code, for people auditing C code, and for people
formally verifying C code.

For comparison, gcc and clang both feel entitled to arbitrarily change
the behavior of "undefined" programs. Pretty much every real-world C
program is "undefined" according to the C "standard", and new compiler
"optimizations" often produce new security holes in the resulting object
code, as illustrated by

https://lwn.net/Articles/342330/
https://kb.isc.org/article/AA-01167

and many other examples. Crypto code isn't magically immune to this---
one can easily see how today's crypto code audits will be compromised by
tomorrow's compiler optimizations, even if the code is slightly too
complicated for today's compilers to screw up. A boring C compiler will
eliminate these nasty surprises; it will prioritize predictability.

I should note that this plan, throwing away gcc and clang in favor of a
boring C compiler, isn't the only possible response to these types of
security holes. Here are several other responses that I've seen:

* Attack the messenger. "This code that you've written is undefined,
so you're not allowed to comment on compiler behavior!" The most
recent time I saw this, another language lawyer then jumped in to
argue that the code in question _wasn't_ undefined---as if this
side discussion had any relevance to the real issue.

* Say that the C "standard" allows gcc and clang to do whatever they
want to all of these "undefined" programs. Yes, we know that it's a
stupid "standard"; that isn't the question. What do we do about the
resulting security problems?

* Blame the security holes on the C programmers who wrote "undefined"
programs. This _might_ be reasonable if there were a plausible plan
to reduce the fraction of "undefined" programs from ~100% to ~0%,
but there isn't. Even if there were, how would this massive code
revision be better than keeping the code and switching to a boring
C compiler?

* Claim that earthquakes in the behavior of "undefined" programs will
teach C programmers to stop writing such programs. "That'll show
'em!" But the reality is that this hasn't worked and won't work.

* Claim that all we need is for some particular "undefined"-catching
tool to be widely used. In fact, these tools are full of false
positives and false negatives; at best they catch a few limited
types of "undefined" behavior, not changing the big picture.

* Claim that a boring C compiler can't possibly support the desired
system _performance_. Even if this were true (which I very much
doubt), why would it be more important than system _correctness_?

Overall I think that these people simply don't understand what most C
programmers want. A boring C compiler will very quickly gain users---not
merely for security but also for predictability in general; people will
appreciate, e.g., having variables automatically initialized to 0. Of
course, the compiler has to support the usual C ABI, so that programs
compiled with this compiler can be linked to libraries compiled with
other compilers (including other languages), and vice versa, allowing an
incremental upgrade process.

I'm told that the Plan 9 compiler tries to be somewhat predictable---

http://article.gmane.org/gmane.os.plan9.general/76989

---but it still leaves many things unspecified, and I'm under the
impression that it has its own ABI. There's a "Fail-Safe C" compiler
that sounds like it defines much more, including safe semantics for
buffer overflows---

https://staff.aist.go.jp/y.oiwa/FailSafeC/index-en.html

---but it's clear that this has its own ABI. There are various projects
such as

http://www.doc.ic.ac.uk/~awl03/projects/miro/

that add more useful semantics to some parts of C _without_ changing the
ABI, but the same compilers will happily screw up other parts of C.
There's a "Friendly C" proposal that targets other parts of C more
relevant to core crypto---

http://blog.regehr.org/archives/1180

---but the big picture is still tons of misguided flexibility for the
compiler writer.

---Dan

Name: Anonymous 2016-07-19 20:35

>>115
There is no quantity involved at all, shit for brains. All quantities are finite, and "bounds" don't even make sense for a fucking scalar. The point is that there's no limit inherent in a particular unbounded equation, algorithm or interface.

All you motherfuckers don't how what the fuck you're talking about, down to basic vocabulary.

Name: Anonymous 2016-07-19 20:45

>>121
Go build yourself an unbounded Turing machine then, wise guy.

Name: Anonymous 2016-07-19 20:52

>>122
Again, you have absolutely zero fucking clue about the words you're trying to use to sound smart. But for some reason, you just absolutely LOVE to see yourself use them, as you showcase your idiocy. How about you leave /prog/ at least until you finish elementary school?

Name: Anonymous 2016-07-19 21:15

>>123
Then she would be to old to post here!

Name: Anonymous 2016-07-19 21:52

>>123
Almost as much as I LOVE to showcase myself plunging my engorged meatpole into your wrinkly little man socket.

Name: Anonymous 2016-07-19 22:03

>>121
I'm not talking about "equations, algorithms, or interfaces". It's about hardware. Most languages and algorithms are Turing complete in that they don't involve explicit bounds. But for any real machine, there exist algorithms that will cause it to run out of memory.

Name: Anonymous 2016-07-19 22:17

>>122
A true Turing machine cannot be built, it's just a mathematical model that's incompatible with the laws of physics.

Name: Anonymous 2016-07-19 23:16

>>127
Thank shit, Captain Sherlock.

Name: Anonymous 2016-07-20 9:15

>>126
The limitations of algorithms have zero to do with the limitations of the machine they might run on. The machine's limitations might infringe on what the algo is doing, but that's an additional, external constraint, not one that has anything to do with the algorithm itself.

Quit conflating software and hardware!

Name: Anonymous 2016-07-20 16:11

>>129
That's what I'm saying. Turing completeness describes a means of expressing algorithms, but no real computer has equivalent power to a Turing machine. There are algorithms that can be expressed in a Turing-complete language, and be run on a Turing machine, but cannot be run on any real computer.

Name: Anonymous 2016-07-20 20:30

>>130
Bullshit. Big fucking steaming Cudder-sustenance bullshit.

Again, name one. Where the algorithm itself cannot be run on a non-infinite RAM computer, regardless of the instance of input data or actual memory quantity.

Name: Anonymous 2016-07-20 21:05

>>131
An infinite loop that increments the input by one each iteration.

Name: Anonymous 2016-07-20 23:10

>>132
Imagine this with dubs

Name: Anonymous 2016-07-21 6:14

>>132
What's the output?

Name: Anonymous 2016-07-21 12:43

>>134
This board.

Name: Anonymous 2016-07-22 15:08

Name: Anonymous 2016-07-22 20:40

>>136
Unlike modern optimizing compilers, whose goal is to make binaries that are as small and as fast as possible at the expense of compiling programs that may be semantically incorrect, kcc instead aims at mathematically rigorous dynamic checking of program compliance with the ISO C11 Standard.
Nice meme, kike. ``Non-standard'' programs are the only reason to use C.

Name: Anonymous 2016-07-22 23:00

There is no "standard" C program beyond Hello World, and even that I'm not sure about.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List