US Homeland Security program language security risks

Hello, https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/coding/295.... I stumbled across this page. It seems that Haskell and other strongly typed functional languages like Ml/OCaml will fare much, much better, e.g. buffer overrun. Thoughts . .... comments. Vasili

Hello Galchin, Friday, January 4, 2008, 12:36:03 AM, you wrote:
I stumbled across this page. It seems that Haskell and other strongly typed functional languages like Ml/OCaml will fare much, much better, e.g. buffer overrun. Thoughts . .... comments.
for me, it looks like saying that haskell better uses CPU registers :) the truth is that modern languages (including Java/C#) doesn't use buffers directly. i don't have experience of their usage, but for Haskell i had memory referencing problems only when using unsafe* tricks -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Galchin Vasili wrote on Friday, January 4:
I stumbled across this page. It seems that Haskell and other strongly typed functional languages like Ml/OCaml will fare much, much better, e.g. buffer overrun. Thoughts . .... comments.
Bulat Ziganshin wrote:
for me, it looks like saying that haskell better uses CPU registers :) the truth is that modern languages (including Java/C#) doesn't use buffers directly. i don't have experience of their usage, but for Haskell i had memory referencing problems only when using unsafe* tricks
Interestingly enough, a few days after this exchange, the first public report was released from a large survey funded by US Homeland Security on security of open source projects. The survey was carried out by a company called Coverity. Among the projects making top grade for security - apparently far better than most proprietary products, though complete information about that is not public - were PHP, Perl, and Python. PHP? Come on, can't we do at least as well? But right now, there is a technical impediment to the participation of Haskell: the Coverity project currently only supports projects written in C, C++, and Java. Haskell compilers are often written in Haskell. Any ideas? Perhaps Coverity's interest could be piqued if they were made aware of Haskell's emergence as an important platform in security-sensitive industries such as finance and chip design, and of the significant influence that Haskell is having on the design of all other major programming languages. The home page for the Coverity open source project is at: http://scan.coverity.com/ Some recent press coverage: http://it.slashdot.org/article.pl?sid=08/01/09/0027229 http://www.zdnet.com.au/news/security/soa/11-open-source-projects-pass-secur... http://www.informationweek.com/story/showArticle.jhtml?articleID=205600229 -Yitz

Yitzchak Gale wrote:
Perhaps Coverity's interest could be piqued if they were made aware of Haskell's emergence as an important platform in security-sensitive industries such as finance and chip design, and of the significant influence that Haskell is having on the design of all other major programming languages.
During one of Simon PJ's tutorials at OSCON last year, a Coverity engineer was in the audience. He told us afterwards that he downloaded the GHC source and gave a try at analysing it while Simon talked. He didn't get far, of course; their software wasn't built for the tricks that -fvia-C plays. But they have at least one person who was that interested. However, it would cost several million dollars to produce a tool as slick as Coverity's for Haskell (Prevent is really very impressive). That would rival Coverity's R&D expenditure to date; they're a small company. I'd have a hard time believing that any such investment could be recouped through commercial sales within the next decade.

Bryan O'Sullivan wrote:
Yitzchak Gale wrote:
Perhaps Coverity's interest could be piqued if they were made aware of Haskell's emergence as an important platform in security-sensitive industries such as finance and chip design, and of the significant influence that Haskell is having on the design of all other major programming languages.
During one of Simon PJ's tutorials at OSCON last year, a Coverity engineer was in the audience. He told us afterwards that he downloaded the GHC source and gave a try at analysing it while Simon talked. He didn't get far, of course; their software wasn't built for the tricks that -fvia-C plays. But they have at least one person who was that interested.
unregisterised, it should be standard C without tricks, though still nothing like ordinary C and therefore possibly not analyzable ~Isaac

Galchin Vasili wrote:
Hello,
https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/coding/295....
I stumbled across this page. It seems that Haskell and other strongly typed functional languages like Ml/OCaml will fare much, much better, e.g. buffer overrun. Thoughts . .... comments.
Human kind has yet to design a programming language which eliminates all possible bugs. ;-)

Hi, Andrew Coppin wrote:
Galchin Vasili wrote:
Hello,
https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/coding/295....
I stumbled across this page. It seems that Haskell and other strongly typed functional languages like Ml/OCaml will fare much, much better, e.g. buffer overrun. Thoughts . .... comments.
Human kind has yet to design a programming language which eliminates all possible bugs. ;-) And we never will. See http://en.wikipedia.org/wiki/Halting_problem .
Greetings, Mads
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Mads Lindstrøm wrote:
Hi,
Andrew Coppin wrote:
Human kind has yet to design a programming language which eliminates all possible bugs. ;-)
And we never will.
Quite so. How can a machine possibly tell whether a given behaviour is a "bug" or an "intended behaviour"? This is impossible. ;-)

Am Sonntag, 6. Januar 2008 14:27 schrieb Mads Lindstrøm:
Hi,
Andrew Coppin wrote:
Galchin Vasili wrote:
Hello,
https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/coding /295.html
I stumbled across this page. It seems that Haskell and other strongly typed functional languages like Ml/OCaml will fare much, much better, e.g. buffer overrun. Thoughts . .... comments.
Human kind has yet to design a programming language which eliminates all possible bugs. ;-)
And we never will. See http://en.wikipedia.org/wiki/Halting_problem .
Greetings,
Mads
Just because I don't know: what bugs would be possible in a language having only the instruction return () (';' for imperative programmers)? Cheers, Daniel

Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin:
Daniel Fischer wrote:
Just because I don't know: what bugs would be possible in a language having only the instruction return ()
Bug #1: You cannot write any nontrivial programs. ;-)
That's not a bug, that's a feature.

Daniel Fischer
Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin:
Daniel Fischer wrote:
Just because I don't know: what bugs would be possible in a language having only the instruction return ()
Bug #1: You cannot write any nontrivial programs. ;-)
That's not a bug, that's a feature.
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Achim Schneider wrote:
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
Have a look about dependently typed languages like Epigram: http://www.e-pig.org/ Regards, apfelmus

Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider:
Daniel Fischer
wrote: Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin:
Daniel Fischer wrote:
Just because I don't know: what bugs would be possible in a language having only the instruction return ()
Bug #1: You cannot write any nontrivial programs. ;-)
That's not a bug, that's a feature.
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
I'm not a logician, but didn't Gödel prove that you couldn't express the (full) arithmetic of natural numbers in such a language? Of course it might be possible to express a sufficiently interesting part of it, but I should be surprised.

On Sun, 2008-01-06 at 16:19 +0100, Daniel Fischer wrote:
Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider:
Daniel Fischer
wrote: Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin:
Daniel Fischer wrote:
Just because I don't know: what bugs would be possible in a language having only the instruction return ()
Bug #1: You cannot write any nontrivial programs. ;-)
That's not a bug, that's a feature.
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
I'm not a logician, but didn't Gödel prove that you couldn't express the (full) arithmetic of natural numbers in such a language? Of course it might be possible to express a sufficiently interesting part of it, but I should be surprised.
What Goedel meant by "arithmetic" is a bit more than one usually associates with the term. One person mentioned Epigram. Most theorem provers and most? (of the few) dependently typed programming languages would fit Achim's criterion depending on the range of "usable" and "usual". Coq, for example, is likely to be capable of formalizing just about anything you'd want. Of course, there is one class of "programming problem" that we can already say can't be handled; namely implementing interpreters (for Turing complete languages). We can formalize analyses, make compilers, prove the compilers correct with respect to a semantics, and even prove that a -description- of an interpreter correctly implements the semantics, but we can't actually -run- the interpreter.

On Sun, 06 Jan 2008 17:19:31 +0200, Daniel Fischer
Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider:
Daniel Fischer
wrote: Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin:
Daniel Fischer wrote:
Just because I don't know: what bugs would be possible in a language having only the instruction return ()
Bug #1: You cannot write any nontrivial programs. ;-)
That's not a bug, that's a feature.
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
I'm not a logician, but didn't Gödel prove that you couldn't express the (full) arithmetic of natural numbers in such a language? Of course it might be possible to express a sufficiently interesting part of it, but I should be surprised.
Neither do I, but if you have non turing algorithms, maybe you could do it.

Daniel Fischer wrote:
Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider:
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
I'm not a logician, but didn't Gödel prove that you couldn't express the (full) arithmetic of natural numbers in such a language?
What if you restricted yourself to the arithmetic of natural numbers modulo 2^64?

On 2008.01.06 15:54:00 +0100, Achim Schneider
Daniel Fischer
wrote: Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin:
Daniel Fischer wrote:
Just because I don't know: what bugs would be possible in a language having only the instruction return ()
Bug #1: You cannot write any nontrivial programs. ;-)
That's not a bug, that's a feature.
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
Total functional programming, yay: http://lambda-the-ultimate.org/node/2003. -- gwern $ Majic shaped Grove infrastructure Spoke BOSS mercur SEIDM BX

That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
Well, I did something like that a few years ago - it was a sort of assembler language, allowing the programmer to, say, sort an array, but not to calculate Akkerman function.

Miguel Mitrofanov wrote:
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
Well, I did something like that a few years ago - it was a sort of assembler language, allowing the programmer to, say, sort an array, but not to calculate Akkerman function.
P. Wadler, in his famous paper "Theorems for free!", writes on page 2: "Indeed, every recursive function that can be proved total in second order Peano arithmetic can be written as a term in the Girard/Reynolds calculus [...]. This includes, for instancs, Ackerman's function [...], but excludes interpreters for most languages (including the Girard/Reynolds calculus itself)." BTW, another name for the Girard/Reynolds calculus is "(pure) polymorphic lambda calculus"; and yes, it is strongly normalizing. (Wadler cites some papers to support the above claim.) It seems there is quite a lot of interesting stuff that can be done in a language where every expression is guaranteed to terminate. Cheers Ben

Am Sonntag, 6. Januar 2008 20:04 schrieb Miguel Mitrofanov:
That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems.
Well, I did something like that a few years ago - it was a sort of assembler language, allowing the programmer to, say, sort an array, but not to calculate Akkerman function.
Epigram even allows you Ackermann’s function. Best wishes, Wolfgang

Daniel Fischer
Just because I don't know: what bugs would be possible in a language having only the instruction return () (';' for imperative programmers)?
/me waves meaningful with his hand. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Mads Lindstrøm wrote:
Andrew Coppin wrote:
Human kind has yet to design a programming language which eliminates all possible bugs. ;-) And we never will. See http://en.wikipedia.org/wiki/Halting_problem .
If you limit usage of general recursion (and rather favor structural recursion) then you can mitigate the halting problem. But there always will be specification bugs (when one implenetes something else than what was needed). Peter.

Peter Hercek writes:
Andrew Coppin wrote:
Human kind has yet to design a programming language which eliminates all possible bugs. ;-) ...you can mitigate the halting problem. But there always will be specification bugs (when one implenetes something else than what was needed).
Look, you are descending an infinite ramp to conceptual hell, the hell of triviality. Now, you will discuss "what is needed", and from FP we get into politics! But, if it is something you need... Read then the passage of "Earthsea" of Ursula LeGuin. There is something about a language in which YOU COULD NOT LIE. It was the ancient tongue of dragons. Now we see why the dragons are extinct... They were incompatible with the Democracy, AND with Computing Technology... Jerzy Karczmarczuk
participants (19)
-
Achim Schneider
-
Andrew Coppin
-
apfelmus
-
Ben Franksen
-
Bryan O'Sullivan
-
Bulat Ziganshin
-
Cristian Baboi
-
Daniel Fischer
-
Derek Elkins
-
Galchin Vasili
-
gwern0@gmail.com
-
Isaac Dupree
-
jerzy.karczmarczuk@info.unicaen.fr
-
Mads Lindstrøm
-
Miguel Mitrofanov
-
Peter Hercek
-
Seth Gordon
-
Wolfgang Jeltsch
-
Yitzchak Gale