Slashdot Mirror


Google NativeClient Security Contest

An anonymous reader writes "You may remember Google's NativeClient project, discussed here last December. Don't be fooled into calling this ActiveX 2.0 — rather than a model of trust and authentication, NaCl is designed to make dangerous code impossible by enforcing a set of a rules at load time that guarantee hostile code simply cannot execute (PDF). NaCl is still in heavy development, but the developers want to encourage low-level security experts to take a look at their design and code. To this end Google has opened the NativeClient Security Contest, and will award prizes topping out at $2^13 to top bug submitters. If you're familiar with low level security, memory segmentation, accurate disassembly of hostile code, code alignment, and related topics, do take a look. Mac, Linux, and Windows are all supported."

175 comments

  1. Any project named NaCl by iamacat · · Score: 5, Funny

    Simply has to be taken with a grain of salt!

    1. Re:Any project named NaCl by palegray.net · · Score: 4, Funny

      Just wait till the KDE project gets their hands on this concept; we'll be seeing a new SourceForge project for KCl any day now.

    2. Re:Any project named NaCl by neomunk · · Score: 1

      So this contest will be a salt assault?

    3. Re:Any project named NaCl by c0d3g33k · · Score: 4, Funny

      Good one. It made me CaCl.

    4. Re:Any project named NaCl by gringer · · Score: 4, Funny

      Q: Why did the bridge end up in police custody?
      A: It was charged with a salt

      Q: Why did the wire end up in jail?
      A: It was connected with a battery

      Q: How do you know the potassium did something wrong?
      A: They were inside a cell

      --
      Ask me about repetitive DNA
    5. Re:Any project named NaCl by Anonymous Coward · · Score: 0

      clearly you're an evil overlord or a witch. They're the only ones who CaCl

    6. Re:Any project named NaCl by The+Raven · · Score: 3, Funny

      A name like that would poison support for their project.

      --
      "I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.
    7. Re:Any project named NaCl by MarkRose · · Score: 4, Funny

      PbF!! Yeah right it did.

      Will Slashdot receive the Nobel Prize in Chemistry for discovering the onomatopoeic bond?

      --
      Be relentless!
    8. Re:Any project named NaCl by Anonymous Coward · · Score: 0

      How the hell did that get past the comment filters!?

  2. NaCl? by Lumpy · · Score: 1, Insightful

    Who else was confused how Salt was going to help software security?

    I shook my head and said What??? as I read it for the third time to realize that they simply have a poorly chosen acronym

    --
    Do not look at laser with remaining good eye.
    1. Re:NaCl? by palegray.net · · Score: 4, Interesting

      Eh, it's an okay choice for a project related to security.

    2. Re:NaCl? by techno-vampire · · Score: 1

      It's also a very reasonable choice from a programming POV.

      --
      Good, inexpensive web hosting
    3. Re:NaCl? by ThrowAwaySociety · · Score: 1

      Who else was confused how Salt was going to help software security?

      Not me. But I still can't see what this has to do with hashes.

    4. Re:NaCl? by spydink · · Score: 1

      NaCl is still in heavy development, but the developers want to encourage low-level security experts to take a look at their design and code.

      ...and to come up with a saline solution.

      --
      Always be sincere, whether you mean it or not.
    5. Re:NaCl? by techno-vampire · · Score: 1
      ..and to come up with a saline solution.

      You're a real salty dog, aren't you?

      --
      Good, inexpensive web hosting
    6. Re:NaCl? by palegray.net · · Score: 1

      When it comes to bad puns, he's certainly worth his salt...

  3. x86 in the browser? Ugh... by gravos · · Score: 5, Insightful

    I'm sorry, I just don't buy this whole thing. x86 in the browser? Ugh... Because all that we need is to further promote an archaic instruction set that won't die because of all the pre-existing code compiled for it. An instruction set that was finally starting to loosen its grip as the industry worked toward more abstract solutions.

    1. Re:x86 in the browser? Ugh... by 427_ci_505 · · Score: 0, Redundant

      Exactly. x86 in the browser? For the love of all that is good, why?

      Preemptive answer to anyone justifying it: no.

    2. Re:x86 in the browser? Ugh... by pohl · · Score: 1

      I was thinking the same thing. The least they could do is use a nice neutral intermediate representation like LLVM bc and JIT compile it to whatever.

      --

      The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

    3. Re:x86 in the browser? Ugh... by tlhIngan · · Score: 2, Insightful

      I'm sorry, I just don't buy this whole thing. x86 in the browser? Ugh... Because all that we need is to further promote an archaic instruction set that won't die because of all the pre-existing code compiled for it. An instruction set that was finally starting to loosen its grip as the industry worked toward more abstract solutions.

      Better yet, we don't have any existing code for this system yet. It won't run ActiveX, so there's no code loss there. And now we're going to have to put the equivalent of Bochs or Qemu now into every browser on mobile devices? If you thought no Flash on the iPhone was bad, now all mobile browsers have to have Bochs/Qemu so they can run these plugins.

      LLVM would be better. Or since these mobile systems are predominantly ARM, and ARM is more or less the predominant architecture everywhere (outselling x86 CPUs mostly because ARM is highly embeddable), why not make x86 emulate the ARM? x86 systems run faster than the vast majority of ARM systems, and would tax the x86 CPU less than a 400MHz one in say, the iPhone.

      And really - why? Do we really need another Java equivalent?

    4. Re:x86 in the browser? Ugh... by debatem1 · · Score: 1

      Personally, I look forward to the day when I can use *any* language as a web language- at native speed, no less. Sounds like a great reason to embed x86 to me.

    5. Re:x86 in the browser? Ugh... by Pentium100 · · Score: 1

      while x86 in browser is not that good security-wise, using virtual machines, like Java, is slow. Just compare Azureus and uTorrent. And a ASM app would be even faster that uTorrent. Instead now we have Java, .NET and other "frameworks" which run one on top of the other and in the end it takes a dual core 2GHz CPU and 4GB of RAM to do the same things at a comparable speed that were possible to do using a 100MHz 486 and 32MB RAM.

      Just compare system requirements for Office2007 on Vista and Office97 on Windows 95. Both Office versions do essentially the same thing.

    6. Re:x86 in the browser? Ugh... by CoughDropAddict · · Score: 1

      Your "abstract solutions" all take orders of magnitude more memory than C, and still suffer garbage collection pauses.

      Why isn't your web browser written using these "abstract solutions"? The answer is the same reason that having real machine code on the client is a win, for those who want to go to the trouble.

    7. Re:x86 in the browser? Ugh... by Thiez · · Score: 1

      > Instead now we have Java, .NET and other "frameworks" which run one on top of the other and in the end it takes a dual core 2GHz CPU and 4GB of RAM to do the same things at a comparable speed that were possible to do using a 100MHz 486 and 32MB RAM.

      That is simply not true. Java eats lots of RAM (and then some more), that is true, but it is not 20 times slower than native. JIT is our friend.

    8. Re:x86 in the browser? Ugh... by IamTheRealMike · · Score: 1

      Well, you're close to hitting the nail on the head but not quite there.

      You need to consider the difference between running on a non-x86 device, and running well on a non-x86 device. Let's say you write a Photoshop killer as a web app using NaCl. Do you really lose because NaCl is x86-specific? No. Even if there was some platform independent bytecode layer it would not help you. It'd just convert a webapp that didn't run at all on your iPhone to one that ran unusably slowly.

      Phones and desktops/laptops are just different devices - hardware is just an order of magnitude less powerful. That's the kind of difference that requires you to rewrite your app from scratch. No bytecode party trick is going to solve that one for you. Nobody is going to start retouching their photos on their iPhone because your webapp runs on it. They're going to wait for a mobile-optimized app to come along, just like how companies serious about mobiles write separate versions of their site for iPhone/Android today.

      So we've established that you'll need to rewrite your app for ARM anyway, regardless of what NaCl does. This leaves PowerPC as the only other architecture that matters. PPC is only used on games consoles though, and nobody browses the web from a games console, thus we can conclude that x86 is the only architecture that matters for performance sensitive web apps and this is likely to remain the case for the foreseeable future.

    9. Re:x86 in the browser? Ugh... by gbjbaanb · · Score: 1

      its not just the end-user resource usage and performance of these things. You also have to install them, I was thinking of installing a pretty subversion web-front end, I looked at sventon and it seemed quite good, no problem installing it... after I'd set up a JSP and Servlet container, plus JSP compiler and JRE. that assume I will get the correct version of all those things.

      Its one thing to run the bloted apps, another to expect the system to be kept upto date with the bloated framework too.

    10. Re:x86 in the browser? Ugh... by Pentium100 · · Score: 1

      after I'd set up a JSP and Servlet container, plus JSP compiler and JRE. that assume I will get the correct version of all those things.

      This is coming from Linux. On Windows you had to install DirectX, VB Runtime and that's it. Get a setup.exe file from floppy, CD or the internet, start it and the program is installed. If your program came on a CD, it usually had all the necessary frameworks and .dll files on that CD. Now it's a bit different, but you can still find .NET and VBRuntime setups on a CD of a program that need them.

      Over on the Linux side, you had to download either the source code or a "package" file called .rpm or .deb, to install using the dsource code, you had to type at least 3 commands (tar, configure, make). .rpm file is more or less like a setup - you open it and the system installs your program, except...
      For some reason none of those files were complete. They needed some version of some lib which needed some other lib. Ok, so libs are like .dll files on Windows, but why not include them in the .rpm file or the source code files? Nowadays, with apt-get and similar software, installing programs is easier, except, of course if your program is not in the database (and who do you pay to get it in?) or your internet connection is down. With Windows, I can install the OS and all programs using their CDs which I either bought or recorded myself (for downloaded software). With Linux, you can't do that... or maybe you can, if you download all of the available libs and put them in DVDs.

    11. Re:x86 in the browser? Ugh... by Anonymous Coward · · Score: 2, Insightful

      I was thinking the same thing. The least they could do is use a nice neutral intermediate representation like LLVM bc and JIT compile it to whatever.

      But what would they call this wonderful new concept? I suggest Java.

    12. Re:x86 in the browser? Ugh... by gbjbaanb · · Score: 1

      on Linux, I'd do "yum install tomcat" and it should handle all the dependencies for me. Unfortunately my particular case I'm running Apache on Windows - its altogether a different story.

      But.. that's not my point. I was trying to say how awkward in general it is to load a bunch of framework layers on top of the basic OS and then keep them updated and secure; not to mention that they tend to soak up proportionately more of your resources than simple native libraries.

    13. Re:x86 in the browser? Ugh... by drinkypoo · · Score: 1

      Are there any free, Free, caching, JIT recompilers which operate on x86 code?

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    14. Re:x86 in the browser? Ugh... by pohl · · Score: 2, Informative

      Amusing joke, but entirely dissimilar. It seems to me that if you want to prove that code doesn't do anything nasty, then a single-static-assignment IR could be very useful. JVM bytecode could never pull that trick. Also, LLVM imposes no runtime requirements whatsoever. None. It and Java are at opposite ends of that spectrum.

      --

      The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

    15. Re:x86 in the browser? Ugh... by Nick+Ives · · Score: 1

      while x86 in browser is not that good security-wise, using virtual machines, like Java, is slow. Just compare Azureus and uTorrent. And a ASM app would be even faster that uTorrent.

      I was going to go off on a rant about how you clearly have no clue what you're talking about but then realised the fact you're clueless would prevent you from really understanding. It comes down to this though:

      Az against uTorrent isn't a fair comparison, uTorrent has far less features than Az.

      Java is as fast as native once compiled. To prove this try writing some basic sorting algorithms in C then Java and compare execution time. The overhead comes from the JIT compilation when you start the app.

      Everything runs on the CPU as byte-code and whatever Java/C/C#/favourite spastic language of the month compiler you use is probably better at generating optimised assembler than you are.

      Or did I just bite a dumb troll? Meh.

      --
      Nick
    16. Re:x86 in the browser? Ugh... by Anonymous Coward · · Score: 0

      It seems to me that if you want to prove that code doesn't do anything nasty, then a single-static-assignment IR could be very useful. JVM bytecode could never pull that trick.

      .Net does. So Java certainly could, though I don't know if Sun did. You can do similar proofs using type-annotated native code, though it would certainly be simpler with a type-annotated SSA IR.

      .Net proofs are very strong: this code can safely run in-process without harming other code. (Singularity OS is a nice application of this: a secure OS without the overhead of context switches.)

      Google's proofs are very weak so they are using x86 features to fill the gaps and also need additional runtime checks (of function returns for example).

      I agree that a cross-platform approach using LLVM would be nicer, but it would be very different to Google's approach which is very x86-specific. And consequently very web-unfriendly.

      And yes, I wasn't being entirely serious before :)

    17. Re:x86 in the browser? Ugh... by Nick+Ives · · Score: 1

      Was just thinking about this post and realised it might not be clear:

      I am aware that Java uses large amounts of RAM and I'm sure anyone reading can point to lots of examples of Java performing worse than some other language for a particular application; my point was those issues aren't due to Java operating in a VM.

      --
      Nick
    18. Re:x86 in the browser? Ugh... by badkarmadayaccount · · Score: 1

      If you find one that operates within an order of a magnitude of native speed, call Sun and Freescale and tell 'em to start cranking out those RISC netbooks at full blast.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
  4. dangerous code impossible? by thermian · · Score: 5, Insightful

    I doubt that. More likely they intend to make its detection and negation easier.

    After all, the best language man can devise can only work as well as the coders who utilise it. If they are forced to cut corners in order to meet deadlines, errors will creep in, and we all know the urge to be first to profit is a prime reason for such things.

    --
    A learning experience is one of those things that say, 'You know that thing you just did? Don't do that.' - D. Adams
    1. Re:dangerous code impossible? by Cyberax · · Score: 4, Insightful

      Nope. NaCl is designed to be secure, read the PDF (I read it some time ago).

      It's not really that hard, VMWare/VBox does something like this for 10 years now.

      There might be some subtle race condition bugs, but so far it looks very well thought out.

    2. Re:dangerous code impossible? by Anonymous Coward · · Score: 0

      Why bother with x86?

      I just dont get why nobody remembers the Juice oberon plugin.

      Michael Franz has been working about safe jit-ing (in java as good as it gets, but much better in oberon) since before netscape became mozilla

      Its just sad all the waste by curent fads, used in ways that werent part of the initial design goals (java, xhtml) mindless imitation ( .net ) or to please the lazy and ignorant crow.

      Talk about moral crisis... any good enginer should see the knowledge frauds under current it trends

    3. Re:dangerous code impossible? by Anonymous Coward · · Score: 0

      You don't get it. Bad programming produces bugs. You can't fix that with any tools. Arbitrary code execution is just one of the infinitely many bugs that could creep in just about any bad code.

    4. Re:dangerous code impossible? by Anonymous Coward · · Score: 0

      No, you are the one that doesn't get it. If you put in the proper work designing and implementing the sandbox environment, then (short of any bugs in the sandbox itself, which will hopefully be minimal since this is open source peer reviewed, and hopefully quickly removed when found) absolutely no amount of sloppy, careless, or malicious code running in that sandbox can endanger the system.

    5. Re:dangerous code impossible? by Nick+Ives · · Score: 1

      short of any bugs in the sandbox itself

      Which are exactly the sort of bugs the GP was talking about.

      --
      Nick
    6. Re:dangerous code impossible? by Goaway · · Score: 1

      Are you saying NaCl is badly programmed, then?

  5. So what you're saying.. by michaelhood · · Score: 2, Funny

    Don't be fooled into calling this ActiveX 2.0 â" rather than a model of trust and authentication, NaCl is designed to make dangerous code impossible by enforcing a set of a rules at load time that guarantee hostile code simply cannot execute (PDF).

    So what you're saying is..

    Using just one half of NaCl could be poisonous, but when sprinkled atop the web as one all is well?

  6. Proofs are only as good as the implementation. by Anonymous Coward · · Score: 5, Insightful

    Beware of bugs in the above code; I have only proved it correct, not tried it.
    - Knuth

  7. Re:gee - sounds exactly like... by Nicopa · · Score: 2, Funny

    Which in turn sounds pretty similar to... Java!

  8. This is like the opening of a monster movie by Sloppy · · Score: 3, Insightful

    where the scientist is saying he's covered all the bases, and nothing can go wrong.

    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    1. Re:This is like the opening of a monster movie by cjfs · · Score: 4, Funny

      where the scientist is saying he's covered all the bases, and nothing can go wrong.

      If this is a monster movie, I'd hate to think what ActiveX was.

    2. Re:This is like the opening of a monster movie by Sloppy · · Score: 2, Insightful

      That's the original. This is Rob Zombie or Marcus Nispel remake.

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  9. Re:gee - sounds exactly like... by Lifyre · · Score: 2, Insightful

    Is .NET open source?

    Has .NET been vetted by experts in the way open source projects like this will be?

    Is .NET likely to ever be cross platform?

    Is .NET for running x86 code?

    Now I'm no expert and could be way off base but there seem to be some pretty major differences here....

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  10. 2^13? by Moraelin · · Score: 4, Insightful

    Admittedly, it's after past 1AM, so maybe my maths stopped working by now, but isn't 2^13 about 8000 dollars for the grand prize? It seems a bit low for all the work of basically reviewing their code and concepts.

    Hostile code disassembly? If it were that simple to disassemble someone else's code and automatically prove that it can't do anything wrong -- including by having security holes exploitable by a third party -- forget the browser, we'd have it standard in the OS or in the last step of make/ant/whatever. We could all stop worrying about antiviruses (who, in turn, would stop needing signatures and heuristics updated all the time anyway), reviewing code by hand to see if all buffers are checked, etc. Just run the magic utility and it'll tell you.

    I'm willing to bet that at least the antivirus makers have tried that before, you know, what with all of them offering some forms of heuristics by now, and none of them got it past the level of hit-and-miss. More miss than hit, in fact.

    Not saying that Google couldn't have got some genius that actually made it work, but at the very least it's not going to be a trivial job digging through all their cases to check if they really checked all possible attack vectors.

    And 8192 dollars doesn't really seem to be much incentive for doing that work.

    --
    A polar bear is a cartesian bear after a coordinate transform.
    1. Re:2^13? by cjfs · · Score: 4, Funny

      Admittedly, it's after past 1AM, so maybe my maths stopped working by now, but isn't 2^13 about 8000 dollars for the grand prize?

      I contacted Google and their reply confirms your approximate amount.

    2. Re:2^13? by Cyberax · · Score: 3, Insightful

      NaCl just does not check that there's no buffer overflows, instead it isolates the program to make sure that buffer overflows do not cause problems.

      I.e. you can can overflow, use dangling pointers and cause all sorts of access violations to your heart's contents inside the NaCl sandbox. But it won't cause a security breach.

    3. Re:2^13? by Tyger · · Score: 4, Interesting

      The PDF was an interesting read, though I agree that the money they are dishing out is pretty paltry for all the free review they are trying to garner. Furthermore, I think they are taking platform neutrality in the wrong direction by locking the idea in to the x86 architecture.

      But about how it would work, they are basically enforcing strict limits on how the code can be structured. The limits are designed to make the code easily analyzed. Anything that falls outside the strict requirements is rejected. It doesn't work for antivirus because they have to deal with any code that comes in without restriction.

      As to why it doesn't work for OS... There is no reason the basic concept wouldn't, aside from the performance penalty and increased code size. (Though further compiler optimization could minimize or eliminate some of that).

      However, if you want to go that route of making an OS do it, you might as well pick up a decent modern RISC architecture, because you're already breaking compatibility with any past program for any OS on the x86 CPU. Most of what they are doing is basically taking something that is standard on RISC and shoehorning it into the CISC architecture of the x86. Namely that instruction boundries can be reliably tested for jumps. They enforce that by requiring jumps only to 32 byte boundries, and then verifying each 32 byte block for correctness. Combined with disallowing self modifying code and eliminating the stack completely, all code that executes can be properly analyzed ahead of time.

      The concept looks sound to me (Experience working low level with x86 architecture) but the security still relies on the implementation. Off the top of my head I can think of several ways to break the sandbox depending on how it is implemented. However the PDF is quite short on the details to evaluate the implementation. Namely, what exactly qualifies as an allowed x86 instruction, and for the syscalls that are checked, what the check is, not to mention the potential for bugs in the syscall handler for what would otherwise be valid calls, and even potentially the state of the OS or process when the protected code is executed.

      Overall, I don't think this is the right direction for the web platform. Theoretically interpreted byte code should be more secure because it doesn't do anything that the interpreter doesn't explicitly allow (Javascript, Java, Flash, etc) and we see where that got us.

    4. Re:2^13? by grcumb · · Score: 3, Funny

      ...you can can overflow...

      Looks like you already did.

      /me ducks and runs

      --
      Crumb's Corollary: Never bring a knife to a bun fight.
    5. Re:2^13? by cryptoluddite · · Score: 2, Informative

      As to why it doesn't work for OS... There is no reason the basic concept wouldn't, aside from the performance penalty and increased code size. (Though further compiler optimization could minimize or eliminate some of that).

      Java generally runs at ~30% slower than C. Unless NaCL can run faster than this then there's no point in it. The demo talk shows it running Quake at ~40 fps. Java quake runs at 200 fps, on a much slower computer.

    6. Re:2^13? by uid8472 · · Score: 2, Insightful

      The idea is that programs are written in a heavily restricted subset of x86 that can be proven safe, where "safe" here basically boils down to not being able to make system calls or otherwise interact with the world without going through the sandbox library. The program might still be compromised by a third party if it's badly written, but then the attacker won't be able to escape the sandbox either.

    7. Re:2^13? by Breakfast+Pants · · Score: 2, Insightful

      The java examples you showed had quake running at 1/8th the number of pixels as the C example from google.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    8. Re:2^13? by gutnor · · Score: 1

      And then we will get the same problem as currently.

      The attacker will not be able to escape the sandbox, but since all the things that matter to you will be running in the sandbox, that means you are still as fucked as before.

      Unless of course you are a sysadmin and the only thing that matters to you is the system, not the user data.

    9. Re:2^13? by Nazlfrag · · Score: 1

      If it were that simple to disassemble someone else's code and automatically prove that it can't do anything wrong -- including by having security holes exploitable by a third party -- forget the browser, we'd have it standard in the OS or in the last step of make/ant/whatever.

      Forget that, you could solve the halting problem, prove P=NP and create true AI. Any effort towards this will be no more or less secure than the implementation of the virtual machine, simple as that.

    10. Re:2^13? by Anonymous Coward · · Score: 0

      You can bet the people who win first (and second, third, etc), are going to be offered jobs at Google, which is presumably above and beyond 2^13/year.

    11. Re:2^13? by Nick+Ives · · Score: 1

      It could be worse, Knuth only offers 80 hex dollars for bugs in TeX. The actual check is worth far more in bragging rights alone!

      --
      Nick
    12. Re:2^13? by Anonymous Coward · · Score: 0

      The joke is on you. They're using the XOR operator. That means you could win up to $15!

    13. Re:2^13? by Alsee · · Score: 1

      No, he just has odd dance hobbies.

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    14. Re:2^13? by Alsee · · Score: 1

      My PC says the exact amount $8,191.997425203.

      What? Why are you looking at me that way?
      So what if my PC is a Pentium?

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    15. Re:2^13? by Goaway · · Score: 1

      but since all the things that matter to you will be running in the sandbox

      They won't be. That would be silly.

    16. Re:2^13? by cryptoluddite · · Score: 1

      The C example from google was running 2262 x 1680? That's a pretty hefty projector that has that kind of resolution. Fact is you're being retarded, and so are the mod's that marked you insightful.

      The actual quake demo on their NaCL page, in trunk, runs at 800 x 600, which is exactly the same resolution as the java examples. The only difference is the NaCL version runs at 40 fps on faster hardware instead of 200+ fps.

  11. Oops... by TheUni · · Score: 5, Funny

    ...guarantee hostile code simply cannot execute (PDF)

    Hah! Was that a jab at Adobe?

    1. Re:Oops... by supernova_hq · · Score: 1

      Actually, it sounds more like a challenge to me.

      I learned a LONG time ago to NEVER, EVER give slashdot a challenge you don't want fulfilled!

    2. Re:Oops... by utnapistim · · Score: 2, Funny

      NEVER, EVER give slashdot a challenge you don't want fulfilled!

      Chalenge:
      1. RTFA!
      2. ???
      3. I win! (profit)

      --
      Tie two birds together: although they have four wings, they cannot fly. (The blind man)
    3. Re:Oops... by reashlin · · Score: 1

      Not only was it a jab but the security vulnerabilities are in the very .pdf you just read.

    4. Re:Oops... by supernova_hq · · Score: 1

      Ironically, giving slashdot a challenge you do want fulfilled tends to return nothing but sarcasm...

  12. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    Is .NET likely to ever be cross platform?

    Is .NET for running x86 code?

    How do you propose to fix the contradiction between those two?

    It can't be cross-platform and platform native.

  13. Re:gee - sounds exactly like... by KZigurs · · Score: 1

    well, java deals with the issue of security just by preventing any code to run. (check out spec for anonymous inner classes and this-> to just get worked up... ;))

  14. Anyone notify Google... by guruevi · · Score: 1

    ...their calendar is off by about a month. It's not April just yet. Either way, even if this is more than an elaborate practical joke, what can it do that Java Applets can't do? I don't know if we need yet another framework to run binaries on computers.

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
  15. Sandbox, not preemptive code analysis by White+Flame · · Score: 3, Informative

    They're asking for people who are familiar in low-level x86 security fields to point out any issues from their experience that could compromise their sandbox.

  16. pre-compiled code? by andy_t_roo · · Score: 1

    tags: "google salt insane crap it security"

    somehow that seems to sum up all the comments above me ...

    anyway, formal software analysis is "hard"; its what compiler developers have been trying to do forever. Proving that code cannot do a specific subset of actions is not quite so hard, but some areas of security such as buffer overflows are inherently run-time only, and very hard to detect at the x86 level which doesn't quite have the concept of data structure, only a blob of memory assigned to a process.

    IMO, given that most new computers have multiple cpu's on-the-fly compilation to the most computer optimised binary is probably the best option - run interpreted for the first 10 seconds while some generic bytecode is compiled to PPC,SPARC,or perhaps even x86 instruction sets. (This assumes that there is a significant benefit by improving computability, and that compiling for a specific flavour of x86 is enough of a speed boost that it is worth while).

    Given that "With reliable disassembly as a tool, our validator can then insure that the executable includes only the subset of legal instructions, disallowing unsafe machine instructions.", why not just start from the byte code and do forward compile as needed, rather than the reverse one?

    1. Re:pre-compiled code? by Anonymous Coward · · Score: 0

      anyway, formal software analysis is "hard"; its what compiler developers have been trying to do forever. Proving that code cannot do a specific subset of actions is not quite so hard, but some areas of security such as buffer overflows are inherently run-time only, and very hard to detect at the x86 level which doesn't quite have the concept of data structure, only a blob of memory assigned to a process.

      It doesn't have to be so hard. I agree with you about the x86 instruction set. But there are plenty of languages out there that are amenable to this kind of analysis. Obviously, they cannot be fully amenable, but significant and absolute limits can be placed.

      Haskell, for example, uses a Turing complete language for its algebraic data types. However, type inference is done via the Hindley-Milnor algorithm at compile. And only one (polymorphic) type has access to the outside world: IO a. If you eliminate or restrict that type, IO is impossible.

      The Haskell analogue to a buffer overflow is probably a "too loose" function definition. Functions are typed. If we have a type A x = B | C x, we defined functions on that type with reference to their "type constructors". In this case, B or C. It would be problematic if a function on A x was defined for B and not C. For example, a complete function definition might look like:

      identityOnAx :: A x -> A x
      identityOnAx B = B
      identityOnAx C x = C x

      Obviously, if either of the equations were missing, the function's definition would be incomplete for the type. The function would not be "total" on the type. The function causes exceptional behavior in these circumstances. Simple best practices mitigate the problem, but the problem is also computationally tenable to determine at compile-time.

      Errors causing corruption of memory in the underlying system are just not possible with a semantically correct Haskell compiler. The type system will just not allow it.

      As much as I have gushed about Haskell, it is still a "research" language. It has found use in scientific, industrial, high assurance, and high-security fields because of the tangible benefits I have described. Microsoft hired Simon Peyton-Jones to continue to develop Haskell and further the functional programming field, and it's ideas are being incorporated into F#, a .NET language.

      Haskell has significant limitations. It is by no means ready for the enterprise, and it probably never will be. It was designed as a convenient vehicle for conducting mathematics and computer science research. Its syntax and semantics are informed by the Howard-Curry Isomorphism theorem, which states that every theorem in a constructive logic is "equivalent" to some computer program. As such, it uses notation and constructs similar to those used in mathematics. An inheritance-like mechanism is implemented Its namespace system is not very refined. F# addresses these limitations, and tones the mathematical syntax down a bit.

      It emphasizes "literate programming" orver enterprise practices. Indeed, using the Literate Haskell option produces source code which is fully compatible with LaTeX, without the need to comment text out. The net effect of all this is that one can sit down and write a proof, compile it, and have a running program.

  17. Re:gee - sounds exactly like... by ClosedSource · · Score: 2, Interesting

    "Has .NET been vetted by experts in the way open source projects like this will be?"

    What open source projects like this have been vetted by experts in the past? Who were they?

  18. Why not look at java? by ADRA · · Score: 4, Interesting

    You could beat them up for many things, but they have a working system of arbitrary code execution that generally doesn't expose your system to risk (unless you tell it to, and only when the code is signed, though self-certs are ok).

    I'm sure there have been plenty of security advisories over the years, but the general philosophy is sane.

    The problem with Java's implementation is that the code is run within Java, which itself has sand-box protection for all executed code. Unless Google is seeking an interpreted language client-side or Google only wants to allow execution of trusted signer code, I think their task is probably a fruitless one.

    --
    Bye!
    1. Re:Why not look at java? by Cyberax · · Score: 1

      No, no, no.

      You can sandbox x86 code. It's been done multiple times in pre-VT virtual machines that use JIT to speed code execution. In short, VMs rewrite the code so 'safe' instructions are executed directly on CPU and 'unsafe' instructions are replaced with calls into virtualization layer.

      NaCl uses the similar approach. But they don't bother with 'unsafe' instructions and just ban them.

    2. Re:Why not look at java? by Jahava · · Score: 3, Interesting

      I am, myself, curious about this. Java seems to have a decent sandbox model already implemented through the JVM and Runtime APIs. Additionally, it is (or can be) platform- and architecture-independent, which seems more conducive towards Internet usage since it doesn't require an x86 instruction set.

      While the Applet model is still viable, I think more mature alternatives (Flash, for example) obsolete it. Rather, I would wager Google is targeting two specific scenarios:

      1. Full-scale protected/sandboxed application deployment, as per their Quake example
      2. Browser-based Web 2.0 content control, essentially replacing JavaScript with native code

      In the case of (1), a nice sandboxed application API for Java would be more than adequate. Most (or maybe even all) of the work is already done for this, including the signing and distribution of the application code.

      (2), which seems really interesting, could still be easily (comparatively) accomplished via a low-level browser control API that is implemented in the various browsers either internally or via add-ons.

      Not to knock Google's approach, for it does seem (from what I've read so far) well-thought out. What I am wondering, though, is what advantage they are seeking in choosing directly-native code over something like Java or .NET. If I recall, most modern Java metrics show it performing competitively with native code.

      I understand that some of the appeal of NaCl is that they are attempting to provide verifiable proof that any code executed in their environment is secure. However, there looks like there would still be a root of trust in the NaCl implementation just as much as Java sandboxing relies on appropriate JVM implementation. I don't believe it is inherently more secure (although NaCl is likely less complex, so easier to evaluate).

      As a research project, NaCl is very cool. However, to reach the goal of web content running at native performance, there are more mature technologies out there such as Java that are also more Internet-conducive. Google shouldn't re-invent the wheel; rather, they should pursue the existing powerful technologies, lay down some API and sandbox groundwork, and push for browser compliance.

    3. Re:Why not look at java? by IamTheRealMike · · Score: 1

      Java has a few problems NaCl doesn't, which is why NaCl has a chance at success and Java didn't:

      • Java was massive in every aspect. It took ages to download, install, and start. It nagged the user to update itself. This led to a very poor user experience. Nobody enjoyed accidentally visiting a web page that used a Java applet because your entire system would grind to a halt for 10 seconds whilst the JVM would heave its bloated carcass into RAM. I am told the very latest versions of Java fix this, but I care not - Java comprehensively blew its chances 10 years ago for this reason alone. NaCl is tiny and has almost no startup time. Google Updater does not nag for updates, it just does it in the background. The user experience is invisible - as it should be.

      • Java was so big it was impossible to secure. Mathematically it was impossible to break, but practically big parts of the JVM were written in native code, and were repeatedly exploited for fun and profit. NaCls "trusted code base" weighs in at a few hundreds kilobytes of code. It's actually feasible to hammer out all the bugs in such a codebase. JVM it's not possible. And anyway, Googles approach to security updates is to do them silently, in the background, enabled by default. Thus NaCl is secure and JVM is not.

      • Java is slow. Yes it is. When Java came out it used tons of memory and tons of CPU to do fuck all. Everyone criticized Java for being slow, so Sun decided to make it fast. And they did ... sorta ... but they spent a decade making it fast cpu-wise and no time at all making it memory efficient. On multi-tasking desktops memory usage is death. You push the machine into swap, and you are dead in the water. Try looking at the memory usage of the string "hello world" in Java vs C++ some time, and then try and come up with ways to fix it, to see why Java never had a chance. I run Eclipse on a dual core MacBook Pro with a gig of RAM and every so often it just "goes away" for 15-30 seconds whilst it garbage collects. What the fuck? NaCL is small and people know how to write C++ code that is efficient in both time and space. Manual memory management is awful but it plays nicely with swapped virtual memory, and that matters.

      • Java required you to rewrite all your code in Java. Tons of useful and well debugged code had already been written in C and C++ but Java only had weak support for it (jni is awful), and of course there was no internet deployment system for jni. NaCL lets you reuse your investment in existing native code.

    4. Re:Why not look at java? by moonbender · · Score: 1

      Tons of useful and well debugged code is written in Java. If there's any general task, chances are very good there's a free Java library to do it. I doubt C/C++ comes anywhere close. I agree with some and disagree with some other of your statements, but I'm not gonna bite, why start a flamewar.

      --
      Switch back to Slashdot's D1 system.
    5. Re:Why not look at java? by tucuxi · · Score: 2, Insightful

      Sure, Java has a great security model and will not cause buffer overflows. But you have to write it in (duh) Java.

      The fun part about NaCL is that it can eat existing (C, C++, pick-your-own compiled language) code with only minor modifications to the compile chain, as long as that code does not make weird system calls. Just make sure that the compiler does not echo any of the 'forbidden' instructions, aligns jumps to 32-bit boundaries, and uses the prescribed instruction sequences for jumps and system calls. And they provide modified versions of GCC that do just that. The paper also says that, in their experience, modification of most programs they tried was, at most, a problem of "a few hours".

      If I had to port an existing app to run as a sort of browser plugin, guess what sounds better: a full rewrite in Java, or a few changes to the Makefile. Because *that* is the selling point of NaCL.

    6. Re:Why not look at java? by kasperd · · Score: 1

      Nobody enjoyed accidentally visiting a web page that used a Java applet because your entire system would grind to a halt for 10 seconds whilst the JVM would heave its bloated carcass into RAM. I am told the very latest versions of Java fix this

      When the first Java version came out, 32MB of RAM was unusual for a desktop machine. A decade later I found myself employed as Java developer and frequently had the need to run 4 JVMs concurrently on a machine with 1GB of RAM. Turns out that would slow the machine to a crawl, even though the machine had 256MB of RAM per JVM and way more CPU power than you could dream of when Java was first introduced to the world. This makes me wonder if the fix was to add more RAM to the machines, or whether Java applications just became that much more heavy during that decade.

      Tons of useful and well debugged code had already been written in C and C++ but Java only had weak support for it (jni is awful), and of course there was no internet deployment system for jni. NaCL lets you reuse your investment in existing native code.

      I agree with your point about Java's initial drawback, but in the meantime a lot of Java code has been written. Today it is a little less clear which of the languages have the most useful code available. How much work would it be to make use of Java code under NaCl? I think it would be a nonzero amount of work, but possibly less than porting code from C to Java.

      --

      Do you care about the security of your wireless mouse?
    7. Re:Why not look at java? by IamTheRealMike · · Score: 1

      You could compile it with gcj, but you still have the problem of the giant runtime library. BTW get back to work dude, what if Gary sees you :-)

    8. Re:Why not look at java? by Simetrical · · Score: 1

      Not to knock Google's approach, for it does seem (from what I've read so far) well-thought out. What I am wondering, though, is what advantage they are seeking in choosing directly-native code over something like Java or .NET. If I recall, most modern Java metrics show it performing competitively with native code.

      The very first paragraph of TFA mentions features like "instruction set extensions such as SSE, and use of compiler intrinsics and hand-coded assembler". They're talking about where you want serious performance. Maybe computer games, for instance.

      NaCl is also probably going to end up more secure than Java. It's not implementing a whole programming language, after all. From the article:

      Our validator implementation requires less than 500 C statements (semicolons), including an x86 decoder and cpuid decoding. This compiles into about 6000 bytes of executable code (Linux optimized build) of which about 900 bytes are the cpuid implementation, 1700 bytes the decoder, and 3400 bytes the validator logic.

      No way is Java or whatever going to be as secure as such a tiny application.

      If machine code is allowed, you also aren't forced to use Java. I mean, it's an okay language, but it's not everyone's favorite. If you have some application already written in C++ and suddenly decide you want it to be runnable from a browser environment . . . now you can, without having to rewrite the whole thing in Java. You can use any library from any language provided it can be compiled to machine code. Etc. Patching a compiler to support NaCl is very simple, according to the paper.

      Of course, forcing everyone to use x86 is a pain, but honestly, it doesn't look likely at this point that we're all suddenly going to move to a different architecture. Allowing websites to run native-speed executables clearly fits in with Google's goal of making web applications superior to native ones.

      --
      MediaWiki developer, Total War Center sysadmin
    9. Re:Why not look at java? by kasperd · · Score: 1

      BTW get back to work dude, what if Gary sees you :-)

      Gary shouldn't expect me to work a lot this week. After all I am on vacation.

      --

      Do you care about the security of your wireless mouse?
  19. Re:gee - sounds exactly like... by Lifyre · · Score: 1

    Ok fair enough. I should have asked if you could run .NET outside of windows. There is a fair shot that this will work in environments like Linux of Mac.

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  20. Re:gee - sounds exactly like... by Lifyre · · Score: 1

    I know that English is a difficult language to master but nothing about my tense suggested the past. In fact since Google is actively pursuing experts to vet their shit I think will be is an accurate statement.

    I'm not sure there ever has been an open source project like this one honestly but those security minded projects that ARE open source seem to do a pretty damn good job and get fixed rapidly when problems are discovered.

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  21. It made me cackle too by tepples · · Score: 3, Funny

    It made me CaCl2.

    (Calcium takes two anions.)

    1. Re:It made me cackle too by Anonymous Coward · · Score: 1, Insightful

      Not necessarily two anions. You just need enough to balance things out. Since Calcium is an alkaline metal, it has two valance electrons in its outer energy level and chlorine, as a halogen, has seven. Since the two react to form an ionic compound, the outer energy levels for each element need to be full. In this case that results in CaCl2, but it could also result in CaO, for instance, which does not consist of two anions.

    2. Re:It made me cackle too by SnowZero · · Score: 3, Funny

      It's easy to get a reaction from a chemical nazi.

  22. 20 minutes by BountyX · · Score: 1

    I spent about 20 minutes trying to defend Google and how cool it would be to have a browser like extension where a user can specify a sandbox and configure it (like sandboxie), then have developers exploit it to execute in that environment. Alas, it is novel at best.

    --
    Trying to install linux on my microwave, but keep getting a kernel panic...
  23. Re:gee - sounds exactly like... by tedu_again · · Score: 1

    www.mono-project.com

  24. Re:gee - sounds exactly like... by obarthelemy · · Score: 1

    Ever heard of cross compiling/interpreting/VMs ?

    --
    The Cloud - because you don't care if your apps and data are up in the air.
  25. Guarantee hostile code cannot execute by bluefoxlucid · · Score: 1

    We're talking about something that's got to be turring-complete in the end, gets evaluated before hand, turned loose to run directly on the processor. I can break that sandbox. A 14 year old could break that sandbox. There is no magically unsafe instruction.

    1. Re:Guarantee hostile code cannot execute by Ash-Fox · · Score: 1

      I await your sample code doing this and sample code from a average 14 year old doing this too.

      --
      Change is certain; progress is not obligatory.
    2. Re:Guarantee hostile code cannot execute by Anonymous Coward · · Score: 0

      I can break that sandbox. A 14 year old could break that sandbox.

      Congratulations, you just won $8,192. Wait, no you didn't.

      Hint: Turing completeness has nothing to do with sandboxing.

    3. Re:Guarantee hostile code cannot execute by Craig+Davison · · Score: 1

      That hasn't been true since like 1980, when processors started coming out with MMUs. Learn: http://en.wikipedia.org/wiki/Memory_management_unit

    4. Re:Guarantee hostile code cannot execute by Craig+Davison · · Score: 2, Insightful

      Of course, Windows didn't have memory protection until Windows NT (1993), and Macs until MacOS X (2001). http://en.wikipedia.org/wiki/Memory_protection

    5. Re:Guarantee hostile code cannot execute by Anonymous Coward · · Score: 0

      If you're allowed to heavily restrict what instructions may be used, it can be made safe. It doesn't need an exact classification into "definitely safe" and "definitely unsafe": the analyzer can classify something as "possibly unsafe" and refuse it permission to run.

      The only question is how restrictive the set of "definitely safe" programs is. The more complex the analyzer, the larger the class may be - but the greater chance there is of bugs in the analyzer. It is not very difficult to allow a "Turing-complete" safe set (within the bounds of real computers' finite address space). That's not a difficult project for even an undergraduate CS student.

      The difficulty only comes when you want the safe set to include a very wide range of efficient programs that have access to a great many non-sandboxed resources.

    6. Re:Guarantee hostile code cannot execute by bluefoxlucid · · Score: 1

      Hey, unless this is an OPERATING SYSTEM LEVEL PATCH to control the program? The MMU doesn't matter here. Considering they want to control WHAT INSTRUCTIONS EXECUTE, there's the obvious weakness that if you can get %eip pointed at an arbitrary binary stream, you bypass their entire security model. Win.

    7. Re:Guarantee hostile code cannot execute by bluefoxlucid · · Score: 1

      This sandbox relies on preventing certain instructions to execute, i.e. the code is validated by a static checker. You can't continuously check the code without shitloads of overhead, which means this is (like anti-virus) a scan-and-allow process: program scans code, determines it's safe, and allows it to run. If the code does things that the program running it hadn't considered, things which allow it to get code that normally wouldn't pass into memory (hint: we have operating system level patches to prevent this, it's not doable at the application level), then it'll break the "sandbox."

    8. Re:Guarantee hostile code cannot execute by Anonymous Coward · · Score: 0

      Considering they want to control WHAT INSTRUCTIONS EXECUTE, there's the obvious weakness that if you can get %eip pointed at an arbitrary binary stream, you bypass their entire security model. Win.

      Uhm, read their paper? The whole idea is to statically prove that you cannot reach outside the sandbox. You can't point EIP outside the code segment. You can't point EIP in the middle of an instruction. You aren't running raw x86, you're running a subset of x86 which is statically analyzable.

    9. Re:Guarantee hostile code cannot execute by Wesley+Felter · · Score: 1

      That doesn't work either, because NaCl makes the code and data segments disjoint so that the code cannot modify itself or generate new code. Since the code never changes, it's sufficient to scan it once.

    10. Re:Guarantee hostile code cannot execute by minsk · · Score: 1

      Fatal Error: Argument rejected due to straw man and false dichotomy. Please contact your argument distributor for more information.

      Proving the set of operations executable by a general application is really hard. Which is why they greatly restrict the structure of the application.

      Exclusively verifying code at runtime is expensive. Which is why they only use a few processor-provided features.

      I have no intention of researching extensively enough to determine for myself whether the system really works. However, it is nowhere near as impossible or idiotic as you seem bent on portraying it.

    11. Re:Guarantee hostile code cannot execute by IamTheRealMike · · Score: 1

      You should read the paper before saying things that are provably false.

    12. Re:Guarantee hostile code cannot execute by Simetrical · · Score: 1

      We're talking about something that's got to be turring-complete in the end, gets evaluated before hand, turned loose to run directly on the processor. I can break that sandbox. A 14 year old could break that sandbox. There is no magically unsafe instruction.

      "Turing-complete" means "capable of performing any computation", not "capable of having malicious side-effects". Turing-completeness has nothing to do with exploitability. It doesn't matter whether you're Turing-complete: if no system calls are present in the code, you can do absolutely nothing to the system.

      --
      MediaWiki developer, Total War Center sysadmin
    13. Re:Guarantee hostile code cannot execute by bluefoxlucid · · Score: 1

      If no system calls are present in the code, there can be no output...

    14. Re:Guarantee hostile code cannot execute by bluefoxlucid · · Score: 1

      Making code and data segments truly disjoint requires operating system level intervention: you have to modify the page table structures associated with these areas of memory to change the protections properly.

    15. Re:Guarantee hostile code cannot execute by Simetrical · · Score: 1

      If no system calls are present in the code, there can be no output...

      Well, technically there can be. E.g., you could write to mmap()ed memory. But it was poorly phrased anyway. The point is that you'd require the code to call special safe functions that would in turn make system calls after carefully validating their input. It might be possible to break out of the sandbox, but only if the safe functions (or the validity checking) are buggy. There is absolutely no reason in principle why this must be breakable, let alone by a 14-year-old.

      It's very similar to virtual machines. Client operating systems on a VM host cannot break out of the jail and take over the real hardware, even though they're running machine code. The sandboxing makes sure that no bad code runs, rewriting if necessary. The approach taken here is somewhat different, because it requires a recompile, so it can make the sandboxing much simpler (refuse to run instead of rewriting, and very harsh restrictions to make it easier to validate).

      --
      MediaWiki developer, Total War Center sysadmin
  26. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    ...nothing about my tense suggested the past.

    Except this part:

    Has .NET been vetted by experts...

    :P

  27. Re:gee - sounds exactly like... by Ash-Fox · · Score: 1

    Ok fair enough. I should have asked if you could run .NET outside of windows. There is a fair shot that this will work in environments like Linux of Mac.

    A port of Microsoft's .net exists for BSD.

    --
    Change is certain; progress is not obligatory.
  28. Re:gee - sounds exactly like... by Lifyre · · Score: 1

    Is it for all of .net or just .net 1.1? I've never tried to use .NET on anything but my windows boxes...

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  29. Okay, some preemptive code analysis by White+Flame · · Score: 4, Informative

    Okay, they do preemptive code analysis inside the sandbox, too. Relevant portion of the PDF (section 2.2):

    The inner-sandbox uses static analysis to detect security defects in untrusted x86 code. Previously, such analysis has been challenging for arbitrary x86 code due to such practices as self-modifying code and overlapping instructions. In Native Client we disallow such practices through a set of alignment and structural rules that, when observed, insure that the native code module can be disassembled reliably, such that all reachable instructions are identified during disassembly. With reliable disassembly as a tool, our validator can then insure that the executable includes only the subset of legal instructions, disallowing unsafe machine instructions.

    This then happens inside a sandbox where CPU segments are strictly enforced and any OS calls are trapped.

  30. Re:gee - sounds exactly like... by bcat24 · · Score: 1

    Which, in some ways, is oddly like the Z-machine!

  31. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    Troll = Disagree?

  32. B.S. Article by Abuzar · · Score: 0

    Stopped reading here:

    NaCl is designed to make dangerous code impossible

    Ironically enough, that in itself is impossible. Obviously bullshit. You just wait, a 16-year old whiz kid is gonna prove it.

    1. Re:B.S. Article by VGPowerlord · · Score: 1

      What, are you saying it's impossible to prove a negative?!

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  33. Re:Which do you prefer? by Anonymous Coward · · Score: 0

    It's a tough choice. On one hand, I am what I am because of how apes behave. On the other handle, ninnle ninnle ninnle ninnle ninnle ninnle ninnle ninnle BATMAN!

  34. Contest? by Anonymous Coward · · Score: 0

    Contests like this are total bullshit. They get thousands of free work hours for a couple grand.

    A few people will make enough money to pay this months rent while Google is off making billions of dollars.

    Don't be a sucker.

  35. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    Easier to mod troll than google? Here - I did it for you:

    The Shared Source Common Language Infrastructure (SSCLI), previously codenamed Rotor, is Microsoft's shared source implementation of the CLI, the core of .NET.

    The Shared Source CLI was pre-configured to run on Windows, FreeBSD (version 4.7 or newer), and Mac OS X 10.2. It is designed such that the only thing that needs to be customized to port the Shared Source CLI to a different platform should be a thin Platform Abstraction Layer (PAL).

    The current version of SSCLI is 2.0, which contains most of the classes and features of version 2.0 of the .NET Framework.

  36. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    Is .NET open source?

    Is NaCl going to be infected with the GPL?

    Has .NET been vetted by experts in the way open source projects like this will be?

    Is NaCl going to be at all secure if just anyone can look at the source?

    Is .NET for running x86 code?

    Is NaCl able to run ARM code?

    Now I'm no expert and could be way off base...

    Correct.

  37. Halting problem? by Anonymous Coward · · Score: 0

    Complete dissasembly to detect hostile code? Isn't the set of all possible hostile actions similar to the set of all possible halting conditions?

    1. Re:Halting problem? by Wesley+Felter · · Score: 1

      A program that doesn't halt is not considered hostile; it's just annoying.

  38. It's a good idea. But will they do it right? by Animats · · Score: 4, Informative

    I've read Google's paper, and I'm reasonably impressed. Basically, they've defined a little operating system, with 42 system calls, the same on all platforms, and defined a subset of 32-bit x86 machine code which can't modify itself and can't make calls to the regular OS. This requires using the seldom-used x86 segmentation hardware, which is quite clever and rarely used. But 64-bit mode has no segment machinery, so this approach doesn't translate to the current generation of 64-bit CPUs.

    The biggest headache with Google's model is that they have to use a sort of interpreter to check all "ret" instructions, so someone can't clobber the stack and cause a branch to an arbitrary location. What's really needed is a CPU with a separate return point stack, accessed only by "call" and "ret" instructions, so return points are stored someplace that code can't clobber. (Machines have been built with such hardware, but there was never a compelling reason for it before.) Google has to emulate that in software. This adds a few percent of overhead.

    Note that you can't use graphics hardware Google's OS. Conceptually, they could add a way to talk to OpenGL, which is reasonably secureable. But they haven't done that. They have a Quake port, but the main CPU is doing the rendering.

    Interestingly, it would be quite possible to make a very minimal operating system which ran Google's little OS directly. You don't need the gigabytes of baggage of Windows or Linux.

    It would also be possible to develop an x86 variant which enforced in hardware the rules of Google's restricted code model. That would be useful. Most of the things Google's model prohibits, you don't want to do anyway. (I know, somebody who thinks they're "l33t" will have some argument that they need to do some of the stuff Google prohibits. Just say no.)

    The main question is whether the implementers will have the guts to say "no" to things that people really, really want to do, but are insecure. The Java people wimped out on this; Java applets could have been secure, but in practice they trust too much library, and library bugs can be exploited.

    NSA Secure Linux has a similar problem. If you turn on mandatory security and don't put any exceptions in the rules, the security is quite good. But your users will whine and applications will have to be revised to conform to the rules.

    Incidentally, the people who talk about "undecidability" and "Turing completeness" in this context have no clue. It's quite possible to define a system which is both useful and decidable. (Formally, any deterministic system with finite memory is decidable; eventually you either repeat a previous state or loop. For many systems, decidability may be "hard", but that's a separate issue. If termination checking is "hard" for a loop, just add a runaway loop counter that limits the number of iterations, and termination becomes decidable again. Realistically, if you have an algorithm complex enough that termination is tough to decide, you need something like that anyway. Formal methods for this sort of thing are used routinely in modern hardware design. Anyway, none of this applies to Google's approach, which merely restricts code to a specific well-formed subset which has certain well-behaved properties.)

    1. Re:It's a good idea. But will they do it right? by hasdikarlsam · · Score: 1

      I could imagine some terribly clever things like, oh, the GHC compiler using code constructs that this forbids.

      But I don't actually know whether it does. And if it does, it would be pretty easy to extend the instruction set to allow whatever it needs safely.

    2. Re:It's a good idea. But will they do it right? by DamnStupidElf · · Score: 1

      What annoys me is that by adding simple capabilities to the real operating system's syscalls, the operating system could do the same job as CaCl without having to compile programs specially. It's simple:

      1. Open a FIFO (or shared memory, or other IPC method).
      2. Fork.
      3. Close all file descriptors except the FIFO.
      4. Free up unused memory.
      5. Drop all capabilities to system calls except for sys_read, sys_write, and sys_exit.
      6. Read the code to execute from the FIFO.
      7. Execute the code.

      As long as the OS does its job, the new process is executing untrusted code perfectly safely. The only communication channel is through the open FIFO, which can be controlled completely by the parent process This requires the OS to handle things like the F00F bug properly, and doesn't account for timing attacks against cryptographic implementations, but I don't think CaCl can prevent timing attacks either. Most importantly, this is platform/architecture independent. It just requires the ability to permanently disable certain system calls for a process.

    3. Re:It's a good idea. But will they do it right? by IamTheRealMike · · Score: 1

      That's too slow for many classes of apps though. For instance, good luck making Mirrors Edge run as a web app with that technique ...

    4. Re:It's a good idea. But will they do it right? by kasperd · · Score: 1

      5. Drop all capabilities to system calls except for sys_read, sys_write, and sys_exit.

      I like this idea (I even suggested it myself at some point in the past). I don't think it has been implemented, but it should be a fairly simple change to the kernel. There is one issue with memory management though. The kernel already has the ability to restrict the amount of memory a process can use, but the process still need to make some system call to allocate it. This leaves a few options.

      • Allocate a fixed amount of memory, which is of course going to waste memory in many cases.
      • Allow the brk/sbrk calls, which are very simplistic so you are still likely to waste memory in some cases because you cannot free memory in arbitrary orders.
      • Allow mmap/munmap, which are flexible enough, but more complicated calls that have been attack vectors to kernel exploits in the past.
      • Allow brk/sbrk to allocate memory an munmap to free it. That way you don't wast memory, but you constantly leak address space. On a 32 bit architecture that leaking of address space means your application is going to run out and then have to be restarted. On a 64 bit architecture you may have sufficient address space that you won't have to worry about this in many cases. Never reusing address space does have the additional advantage, that many use after free bugs are easier to debug.
      --

      Do you care about the security of your wireless mouse?
    5. Re:It's a good idea. But will they do it right? by Alsee · · Score: 1

      (I know, somebody who thinks they're "l33t" will have some argument that they need to do some of the stuff Google prohibits. Just say no.)

      Me! Me! Me! I am extremely l33t! Check this out:

      You're doing genetic programming, evolving carefully constrained native code. It's essentially an extremely advanced form of self-modifying code, which is prohibited in this system. It is possible to still do it by interpreting the evolved code, but the speed penalty would be atrocious.

      Grin.

      P.S.
      For those who aren't familiar with it, genetic programming is a technique where you treat a string of code like DNA, and you let these programs compete and mate and mutate almost exactly like biological evolution. You have to carefully limit what code can be generated, so that you can safely jump into and out of of it without it touching anything anything outside the assigned work area, you have to have either no loops or carefully self-limiting loops to ensure the code returns, but it is possible and it does work. You can have a population of evolving programs, and they do successfully evolve to solve the task they are competing to solve. Most implementations of genetic programming work by safely interpreting evolved pseudo-code, but the daring and "l33t" way to do it is to evolve and directly execute native machine code :) See "Genetic Programming".

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    6. Re:It's a good idea. But will they do it right? by DamnStupidElf · · Score: 1

      I think pre-allocated memory would be the most useful. Most untrusted apps need to have some sort of resource limitation on them anyway, so it would make sense to define a hard limit for memory usage and just allocate it at the beginning. Since most of it would be unused, it wouldn't actually get physical pages until it's used (in Linux, at least). Nice-ing the process before executing the untrusted code would also probably be a good idea. The best thing is that capabilities on the system calls would essentially be a per-process bitmap with as many entries as the system call table, and require only a couple extra instructions to check on each system call. I might do that later today, just for fun...

    7. Re:It's a good idea. But will they do it right? by DamnStupidElf · · Score: 1

      Since when is shared memory too slow for applications? The connection doesn't have to be merely a FIFO, it can be a shared mmap between the parent process and the untrusted child process. Any IPC mechanism works, as long as the syscalls that implement it are safe for untrusted code to use.

      OpenGL functions, for instance, would require wrappers to move untrusted memory into trusted memory, sanity check it, and then perform the calls to the real OpenGL API. This is not as bad as it sounds; textures, models, shaders, etc. would be loaded once into trusted memory and checked, and from there the untrusted application could still reference them. Most games preload that information anyway, and most of the dynamic things in the game are the lights and the matrices for manipulating the vertex/surface lists.

    8. Re:It's a good idea. But will they do it right? by kasperd · · Score: 1

      The best thing is that capabilities on the system calls would essentially be a per-process bitmap with as many entries as the system call table, and require only a couple extra instructions to check on each system call. I might do that later today, just for fun...

      If you do, let me know where to find the patch.

      --

      Do you care about the security of your wireless mouse?
    9. Re:It's a good idea. But will they do it right? by DamnStupidElf · · Score: 1

      seccomp is almost exactly what I was thinking of, but written about 4 years ago. All the good ideas are implemented by the time I think of them...

    10. Re:It's a good idea. But will they do it right? by kasperd · · Score: 1

      seccomp is almost exactly what I was thinking of, but written about 4 years ago.

      Nice it is even enabled in Fedora kernels. I'll start using this whenever I can. It is less flexible than what I had in mind. I would have a bitmap of permitted system calls, from which you would only be allowed to remove calls. SECCOMP just have a list of four permitted calls. And I would have given an error code on attempts to access disallowed calls rather than just SIGKILL. It makes PR_GET_SECCOMP pretty pointless, because if you are in secure mode you are not permitted to call it anyway. I wonder why sigreturn is permitted, it is a fairly complicated call, that I could imagine could be used as an attack vector. Here is a bit of code for anybody who want to start playing around:

      #include <stdio.h>
      #include <sys/prctl.h>

      void state()
      {
      printf("%d\n",prctl(PR_GET_SECCOMP,42,42,42,42));
      fflush(stdout);
      }

      int main()
      {
      int i;
      state();
      state();
      prctl(PR_SET_SECCOMP,1,42,42,42);
      for (i=0;i<10;++i) {
      printf("%d\n",i);
      }
      state();
      state();
      return 0;
      }

      --

      Do you care about the security of your wireless mouse?
  39. Another useless software from Google by edivad · · Score: 0

    Life is always nice at Google, relentlessly baking useless code 24h/day 7days/week.

  40. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    http://www.mono-project.com/Main_Page

  41. Won't work on 64-bit Windows? by Myria · · Score: 1

    I heard that much of the technique behind the design is to create x86 segments with a limit such that the sandboxed program can only access certain areas of memory within the process space. If this is true, the technique won't work at all in 64-bit Windows: Win64 doesn't have an API, documented or otherwise, to create segments in the LDT, unlike Win32. In fact, XP 64 and Vista 64 hardcode the LDT register to null. (Windows 7 64 has a limited LDT that appears to be related to SQL Server's "User-Mode Scheduler".)

    Does anyone know whether I'm correct about Google's project?

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
    1. Re:Won't work on 64-bit Windows? by cjfs · · Score: 1

      Brad Chen touched on it a few times in the video. Currently wouldn't support it and any future plans were still up in the air.

    2. Re:Won't work on 64-bit Windows? by Wesley+Felter · · Score: 1

      Fortunately, Win32 binaries (like NaCl) still run on 64-bit Windows.

    3. Re:Won't work on 64-bit Windows? by IamTheRealMike · · Score: 1

      64bit doesn't offer any compelling advantages to most end users, so the ability to run 32 bit code isn't going away anytime soon.

  42. Re:B.S. Article (No it's not) by TheSunborn · · Score: 2, Insightful

    No it's not impossible. What is impossible is to reject "exactly all dangerous code" but they don't claim to do that.

    A simple implementation will simply reject all code. There will not be any way to get dangerous code past that implementation so I have just made what you said was impossible.

    What Google does is that they try to verify that the program is not dangerous. And if they can verify(Create a proof) that the program is not dangerous then they run it. Else they reject it.
    This will result in Google rejecting valid programs which are not dangerous, but if google runs a program it knows its safe to run.

    To be really useful you develop the compiler and verify code together, so that the compiler only issue code that it knows the verifier can verify.

    Java does something like this. The java compiler only output code that it know that the Jvm can verify as valid, but if you write your bytecode directly, you can write valid non dangerous code that
    the classloader will reject, because it can't prove that it's not dangerous.

  43. The Daily KDWTF by daveime · · Score: 1

    Today's kdawson WTF is proudly brought to you by the writers guild and Microsoft.

    In an attempt to appeal the the nerds amongst us, kdawson today cited prize money amounts in Power notation.

    For those of us who aren't binary nerds, and weren't able to pull the magic number straight the the subconscious regions of our brains, $2^13 = $8192 dollars.

    I mean come on, does anyone still take this person seriously ?
     

    1. Re:The Daily KDWTF by daveime · · Score: 1

      Hate replying to myself, but does anyone else see the irony of this statement from the summary ?

      that guarantee hostile code simply cannot execute (PDF)

      Bearing in mind that PDFs are now also toxic, and very dangerous to download from anywhere.

  44. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    > What open source projects like this have been vetted by experts in the past? Who were they?

    The Linux kernel has been vetted several times. Not to mention there have been many people who tested their automated bug finders on random large open source products. Examples fail me at 3 AM, but I'm pretty sure there were some recent Slashdot stories about them.

    Separately, the Open BSD kernel gets a full audit every time a new kind of bug is discovered. That's why they've had only one remote root exploit in the default install in years now.

  45. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    Most shit I've written works under Mono.

    At least you admit it.

  46. lyesmith by Anonymous Coward · · Score: 0

    If I am not mistaken Adobe has a similar project called Alchemy. They are compiling C code into swc.

    http://labs.adobe.com/technologies/alchemy/

    I guess if you want to run proper applications in your browser you need this.

    So Google will have Native Client.
    Adobe will have Alchemy.
    Can't wait MS coming out with the same stuff.

    That will be beautiful. A major mess up on all side.

    1. Re:lyesmith by Goaway · · Score: 1

      MS already has .NET.

  47. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    Which in turn sounds pretty similar to... Java!

    Actually the validation of NaCl code sounds a lot like validation of java bytecode. However NaCl is a subset of valid x86 code, which means it should be able to perform faster than java bytecode. If you are not running on an x86 architecture, you are probably going to get better performance from java bytecode. Java bytecode is a higher level than x86 code, since it is inherently tied to the java OO model (Not saying this is good or bad, just that it is different). A java bytecode JIT compiler can use the full x86 instruction set if it wants to, so in theory it could perform better than NaCl. But the JIT compilation and the difference between the OO model and the native code does give some performance overhead, compare this to the performance you lose by restricting code to the subset of x86 allowed by NaCl, and the outcome is unclear. (I guess NaCl is going to come out a winner, but maybe java JIT compilers will get close). I wonder if it would make sense to compiler java bytecode to NaCl code, and maybe even implement the JIT compiler in NaCl code.

  48. Reuse of Existing C Code by Elbows · · Score: 1

    It seems like the real benefit is not performance, but the ability to reuse existing C/C++ code bases on the web. A lot of people are looking at making web versions of well-established desktop apps (look at photoshop.com, for example). Currently you have to do this in Javascript/DHTML or Flash, which means throwing out all the code from your desktop app and writing something new from the ground up, which hopefully ends up looking more or less like the original system. It's a huge amount of work, and you end up with two completely separate code bases to maintain.

    If you could just recompile all your C code and dump it in the browser, it's a huge win. Of course you'll still need to write a browser-friendly UI (and I'm not sure how that works in NaCl currently), but all your back-end code (like the filters in Photoshop) could be reused.

  49. Re:gee - sounds exactly like... by Lifyre · · Score: 1

    Thank you. I didn't know and in my limited googleing (I'm in Iraq) I didn't see the things you were talking about. Why you're modded Troll and not imformative I don't know.

    Maybe Moar == Troll

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  50. Re:B.S. Article (No it's not) by Anonymous Coward · · Score: 0

    To be really useful you develop the compiler and verify code together, so that the compiler only issue code that it knows the verifier can verify.

    The NaCl system does this.

  51. Money? by fulldecent · · Score: 1

    Would you like a check for:

    $$$$$$$$$$$$$8192

    --

    -- I was raised on the command line, bitch

  52. interpreters? by jtgd · · Score: 1

    NaCl is designed to make dangerous code impossible

    Does this include the case where the machine code implements a byte code interpreter along with a bunch of byte code data? That makes analyzing the code a bit more complex.

    --
    J
    1. Re:interpreters? by Wesley+Felter · · Score: 1

      Interpreters are not dangerous and are no more difficult to analyze than regular code. IIRC someone compiled Python for NaCl and it works.

  53. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    > Is .NET open source?

    Microsoft's implementation is not, of course, but Novell's is: http://mono-project.com/Main_Page
    and the spec is standardized: http://www.dotnetexperts.com/ecma/

    > Has .NET been vetted by experts in the way open source projects like this will be?

    Depends if you consider people like Herb Sutter and Anders Hejlsberg experts.

    > Is .NET likely to ever be cross platform?

    http://mono-project.com/FAQ:_General#Mono_and_Microsoft

    > Is .NET for running x86 code?

    No, and thats a good thing.

    > Now I'm no expert and could be way off base but there seem to be some pretty major differences here....

  54. WebStart by FunkyELF · · Score: 1

    Too bad Sun is uninterested on having more desktop adoption of Java. Sun's incompetence / arrogance is the reason we have this and SilverLight.

  55. Some attack suggestions by kent.dickey · · Score: 1

    I browsed the PDF, and it seems they have some trampoline code in the first 64KB of memory that has unsafe instructions that allow that code to do more dangerous things. The idea is that the untrusted code can only interface with the trampoline code, which checks that nothing funny is going on, then it interacts with the real OS.

    I see a primary weakness is that they support threads. Start a thread, and have it try to interfere with another thread calling the trampoline code. Basically, mess about with the "stack" trying to get it to jump to a non-32-byte boundary. The trampoline code seems to be a very weak spot, and attacking it seems like the easiest area to go after. It's very difficult to make the trampoline code safe from attacks from other threads in the same address space (it actually may not be possible to make it bullet proof). Try to attack the trampoline to make failing security checks into passing ones--the idea is the trampoline code has to store data somewhere--just try to modify it.

    I think they may have some weaknesses in mmap, mprotect, etc.--they need to check these calls very carefully. Try to remap the trampoline code to another address (which would then be vulnerable). Try to map in a library over the trampoline code. The PDF itself said they check open() carefully, but then not read()...this shows they are probably being too clever and not defensive enough.

    Another area is create races--is it possible to provide one copy of the code to the checker, and another copy actually gets loaded into memory? This is surprisingly difficult to get right, but depends a great deal on how they load code (or, rather, how the code is presented to them in the first place, I guess by a browser).

    Note that any check the trampoline code makes might be bypassable by a clever thread, which changes the data after the sandbox check is complete but before the OS call is made. OS calls which take in buffers probably don't "snapshot" the data to protect it being changed by threads, so there may be a large window in which threads can break the sandbox security (the security check passed, but then a thread changes the data to unsafe values before the OS acts on it).

    And of course, try to break out of the sandbox by exposing OS-level bugs or just extreme events such as opening too many files, overflowing structures, to create a way out of the sandbox.

    If you have time to try all of the above, enjoy your $512.

  56. What about non-x86 platforms by zuperduperman · · Score: 1

    I'm baffled that after all the tireless work of browser implementors, virtual machine implementors (java etc.) over the years, somebody has come up with a brainwave that making a runtime platform tied directly to a specific to a processor architecture is a good idea. Sure we happen to be at a juncture in history when we have 3 major platforms (windows, mac, linux) all primarily using intel processors, but this still seems nutso nonetheless. The fact that the described scheme does not work on 64 bit processors seems to make it completely useless as surely 64bit is going to be come standard within a year or two.

  57. Re:Which do you prefer? by Anonymous Coward · · Score: 0

    Have it both ways.

    You are what you are because of how BATMAN behaves!

    or

    Ninnle ninnle ninnle ninnle ninnle ninnle ninnle ninnle APESHIT!

  58. Re:gee - sounds exactly like... by Lifyre · · Score: 1

    While I know that the GPL has it's problems I've never heard it termed an infection before, though your opinion that it's like a virus should be surprising since by your logic Windows is secure because you can't look at the source.

    Yes, it would be nice is NaCl could run ARM code and I know that running x86 code is not likely to end well. I'm open about my lack of expertise, yours is obviously suspect, and I at least had the balls to sign my inflammatory ignorant statements.

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  59. Re:gee - sounds exactly like... by Lifyre · · Score: 1

    smexy it means I might be able to start running my work box as a linux box and get away from all the crazy shit they restrict on windows machines (no USB on windows boxen)

    --
    I'll meet you at the intersection of "Should be" and "Reality"
  60. It may be a Java equivalent, but it's C by egghat · · Score: 1

    So there you have reason one: It's C and there's a lot of code in C that could be useful in a browser context. Think of multimedia codecs. Stop blaming the HTML5 committee for not including Ogg theora in their HTML5 standard. "Just" port Ogg to NaCl and it runs in our browser. Bingo! Think of games like Quake which are brought to your browser with ActiveX. With NaCl it would run under Linux and OS X too (on X86 ...).

    And regarding LLVM: I see no reason why NaCl and LLVM could not profit from each other.

    And if you are really cool: Port KDE to NaCl ;-)

    --
    -- "As a human being I claim the right to be widely inconsistent", John Peel
  61. Ninnle NOT Flamebait! by Anonymous Coward · · Score: 0

    I don't understand why Ninnle keeps getting modded down.

  62. And again, a FAIL from the beginning! by Hurricane78 · · Score: 1

    As every security expert knows, you start a set of rules by forbidding everything, and then making the smallest possible exceptions to make it run. And nothing more.
    This looks the other way around. So it is just as flawed as all those Internet-filters that we constantly bash here on Slashdot.

    Oh well, call me backwards, but I went from web application development with JavaScript and PHP to classical software development in Haskell, with dynamic libraries an plug-ins.
    I felt the whole web app space to be a major case of the "inner platform effect"

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
  63. Re:gee - sounds exactly like... by Anonymous Coward · · Score: 0

    You said balls, hehe. How about using your full Real Life name to sign your inflammatory ignorant statements though? Anything other than that doesn't require balls.

    The reason I don't use a username anymore is because I disagree with the karma system. I don't agree with the hive mind here at /. and eventually all of my posts end up starting at less than zero.

  64. Re:gee - sounds exactly like... by Lifyre · · Score: 2, Insightful

    Fair enough. Sean Patrick Timmons, I'm sorry I'm not going to give you my SSN and DOB, though you might be able to find them anyway.

    While I understand your issue with the hive mind the disagreements appears to be more rooted in ignorance than just opinions. Your supposition that closed source is more secure because the code can't be inspected is hilarious. In the same way that turning off a light and shutting the door makes a room secure.

    --
    I'll meet you at the intersection of "Should be" and "Reality"