9 ms·
I hope that never happens, because I think such a world would be extremely dystopian. Strong safety guarantees sound very beneficial at first ("safe" anything i
by userbinator 12y ago
I hope that never happens, because I think such a world would be extremely dystopian. Strong safety guarantees sound very beneficial at first ("safe" anything in general tends to evoke that response), but as shocking as it may seem, a lot of the freedom we have today is a result of using "unsafe" languages like C: iOS jailbreaks, Android rooting, homebrew on game consoles, and many other examples of freeing one's devices from restrictions imposed by the original manufacturer and giving control back to the user depend on this. These bugs and vulnerabilities, although they can be exploited maliciously, are in some ways like an escape hatch from the tyranny of corporate control. If strongly safe languages become the norm, all these would disappear and our computing experience become even more locked-down and restricted. The thought of them being used for DRM is scary (I remember reading an academic paper that suggeted this as one of their applications, and that's one of the thing that provoked me into really starting to think about this.) Even open-source software where safer languages appear most beneficial can be used against the user.
Ultimately is a security vs. freedom tradeoff, and I think we've sacrificed too much of the latter already.
- DCKing 12y agoI'm baffled by that opinion. The fact that memory-unsafe software keeps on being produced in C/C++ is a good thing? The capabilities of criminals to run local (or remote!) root exploits on many devices is offset by the fact that some hackers can tinker with them? Freedom should be achieved in different ways. Please don't make freedom and security contradictions.
- userbinator 12y agoYes, it's definitely controversial but I think a little bit of insecurity is a good thing but not too much -- the question is how much. Consider that had the NSA been far more secure in their processes, the whole Snowden thing may have never happened... which is somewhat ironic. > Freedom should be achieved in different ways. Please don't make freedom and security contradictions. In an ideal world, they wouldn't be. Unfortunately that's not how it is in reality.
- DCKing 12y agoSo what do you think about the NSA's capabilities to easily rootkit your "free" exploitable device? I don't think this is a consistent worldview.
- coldtea 12y agoFreedom is not about consistency in everything.
- DCKing 12y agoI've never said that freedom is about consistency. Opinions should be consistent if they are to be taken seriously. This guy wants to intentionally leave software exploitable, ready to be unknowingly hacked by criminals or governments, and call it freedom. And he gets upvoted for it!
- userbinator 12y agoWhat's not consistent? Also, it seems that "criminals" are the new "terrorists".
- 9mit3t2m9h9a 12y agoTo play a devil's advocate, I want to answer this directly as answered. Available information indicates that NSA used various coercion tactics to ensure cooperation from various companies and that it has the methods to ensure hardware modifications in its own interests. So the damage to NSA from improving security too much is less than damage to my ability to use the computing device I have paid for as an actual computing device. Of course we should also consider smaller threats. But the better the platform is locked down, the less limitations there ae for advertiser-friendly platform design, which makes people expect a lot of permissions requested by applications, so phishing and trojans become easier. The problem here is about the effects of scale: it is hard to produce just a few thousands phones with good specs.
- userbinator 12y ago
- weland 12y agoPractical experience shows that once you run into even routine systems programming elements, like writing device drivers and whatnot, you eventually have to concede some safety, or end up with an unprogrammable behemoth of such baroque complexity that you likely have more security holes, just of some other kind. There has been a lot of research into this back in the 1990s; most of the useable results produced security by architecture rather than tools.
- pohl 12y agoIt's almost as if what one would want is a language where you could shrink unsafe operations to as small a footprint as possible by confining them within a block with a special keyword, like this: unsafe { … } Someone should invent such a thing. Edit: …yeah, I was being tongue-in-cheek. This is exactly what Rust provides. http://doc.rust-lang.org/rust.html#unsafety http://doc.rust-lang.org/rust.html#unsafety "...When a programmer has sufficient conviction that a sequence of potentially unsafe operations is actually safe, they can encapsulate that sequence (taken as a whole) within an unsafe block. The compiler will consider uses of such code safe, in the surrounding context…"
- ygra 12y ago- http://msdn.microsoft.com/library/chfa2zb8.aspx http://msdn.microsoft.com/library/chfa2zb8.aspx - http://doc.rust-lang.org/rust.html#unsafe-blocks http://doc.rust-lang.org/rust.html#unsafe-blocks
- Touche 12y agoIf I call a function that is running unsafe { } inside of it, do I know? Because I really want to know. And I want my function to be marked as unsafe as well (because it is) as well as any function calling my function, etc.
- steveklabnik 12y agoYou don't know, but you can use a compiler flag that will tell you if you are. > I want my function to be marked as unsafe as well (because it is) This misunderstands the nature of `unsafe`. `unsafe` means "I promise that this is actually safe, even thought it can't be inferred." Take, for example, a type which has mutable, shared state, but enforces all access through a mutex[1]. This type presents a safe interface, but the compiler can't know that it's safe, so you have to use `unsafe` internally. 1: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html http://static.rust-lang.org/doc/master/std/cell/struct.RefCe...
- taeric 12y agoI think a lot of us are somewhat happy with freedom being maintained by the laws of the land. Granted, those do seem under attack, as well. Oddly, by a similar mantra as what leads type safety. Consider, in a "type safe" law system, intent doesn't matter. Only what you did. Now, look at the laws that run on that principle. Now, I personally think this is probably orthogonal to type safe programs. But I'm not completely convinced, yet. Type safe programming seems hamstrung by the fact that a type system only really protects that which is specified in the type system. Which seems to mean you can't easily have a variety of ways to do things, as ultimately the type system has to grow to encompass all of the system. Now, I grant I'm probably just soured by some bad systems in the past where a change to one part required a rework of the entire system.
- Jtsummers 12y agoMost type safe systems have escape hatches that allow for conversion between types. Also, IME, type safe languages don't hobble me as a programmer. However, the systems and things I work on (and am trying to get work on) have generally well considered specs associated with them. Be it radio protocols, file formats, or whatever. A type safe language (haskell, sml, ocaml, ada, rust (it seems, not explored it much yet), etc.) can really help with these projects. Instead of needing a dictionary translating what magic # 134 means if it's used in this context (god, these old fortran programs break me), we can actually specify things in code in sane, clear ways that map from spec/design to code cleanly. OO, in theory, can help us with this, but it also adds a lot of overhead to create a ton of classes when really we want integers that the compiler knows some are meant to be temperature and some are meant to be pressure. If you start adding temperature and pressure, it flags it. If there's some formula where that actually makes sense, you deliberately, intentionally, explicitly handle the conversion. This is a good thing. Slightly more verbose code, but such a boon for mainenance and v&v work.
- taeric 12y agoDoesn't shock me too much. The experience I have had is when folks basically try to do their programming in the type system. This can work for some cases, maybe all if you "do it right." I've not been lucky enough to see that. Instead, I like it when the types are basically there to help, not force, you.
- pjc50 12y agoGood post. We need to remember that security is a transitive verb: we secure something against something or someone. As you say, DRM is "securing" a device against the user.
- thegeomaster 12y agoMore freedom for mediocre or bad coders = more ways to fuck up. More freedom for good coders = more ways to make great things (and fuck up). So basically it's a tradeoff. If people working on the Linux kernel were very careful and good hackers, writing in C would be much less of a risk than letting fresh-out-of-college programmers tinker with memory on the low-level. But even very careful and good hackers can screw up sometimes—see what happened with OpenSSL. I don't see a reason not to use Rust except for performance, or when the unsafe features of C are required to get the job done. I can't say a lot here because I've only seen Rust's syntax and feature list and never programmed in it. (On the other side, I've written a fair amount of (functioning) code in C, and I feel that debugging race conditions coupled with memory management bugs has shaved a few years off of my expected lifespan already.)
- Rusky 12y agoRust shouldn't be a performance problem. The language semantics allow for all the things that make C fast, as well as doing a better job at aliasing. Idiomatic Rust will drop a little bit, to the level of idiomatic C++, but there's nothing stopping you from optimizing that to C levels in exactly the same way when necessary.
- thegeomaster 12y agoWhat about bounds checking and stuff? Sorry for my ignorance on the matter.
- Jtsummers 12y agoIt seems you can use unsafe versions of vectors/arrays/strings to bypass bounds checking. Essentially, if you're very confident that your code is correct, then you can speed it up (is it worth it?) to C levels. On the other hand, a lot of bounds checking is probably going to happen where you'd manually enter it into C/C++ code anyways (if you wanted to avoid certain errors).
- portmanteaufu 12y ago
- sysexit 12y agoFortunately Rust has unsafe { ... }
- andrewflnr 12y agoIt's interesting to think of an insubordinate dev being tasked to write some horrible locked-down system in Rust and going, "yeah, this thing has to be in an unsafe block because xyz, oh, woops, I guess I introduced a jailbreak opportunity".
- guelo 12y agoI doubt that most jailbreaks have anything to do with buffer overflows or pointer bugs in C code.
- Jtsummers 12y agoThe iOS jailbreaks used to (haven't followed them recently) involve exploits in C/C++/Objective-C code. They've taken advantage of various system applications to install the jailbreaks. Some used exploits in PDF handling, others in USB handling.
- andrewflnr 12y agoThis is a really frightening post. There is a real tradeoff between security and freedom, but memory safety is not where it manifests. It manifests in the fact that if you give the user power to mess up their system, sometimes they actually do it. However, the dichotomy between freedom and basic memory safety is false and needs to be fought tooth and nail. Your believing it is a minor victory for the corporations you excoriate. When we build the next generation of free operating system, I want it to be as secure as humanly possible. Your device isn't free if the NSA or some criminal has owned it.
- userbinator 12y agoHow is it a false dichotomy if things like jailbreaks and console homebrew essentially rely on the lack of memory safety to work? > Your device isn't free if the NSA or some criminal has owned it. It's not free if you can't own it either - and that's where the problem lies: how do we stop the secure systems we create from being used and secured against us.
- andrewflnr 12y agoIt's a false dichotomy because there's a possible world where you don't have to resort to that crap to get control of the device you bought, where you're in charge at the start (looking back, I wasn't explicit about this, sorry). That's what we should be working on, not holding back the state of the art of programming languages. That's the wrong place to attack the problem.
- userbinator 12y agoThat would be an ideal world, and I agree that safer languages definitely do make sense there, but the big question is how do we get there. > That's the wrong place to attack the problem. Then what do you think is the - currently practical - way to attack the problem? I think there is a bit of misunderstanding I created in my original post; I'm not completely against security and hate buggy software as much as anyone, but only pointing out that we rely on insecurity for many good things and freedom we have today, and thus we should give more consideration to the implications of using more secure languages before they get to the point of becoming so popular that there is no turning back. They're just such a good fit to be used in trusted computing/DRM systems, and that's what scares me the most.
- imanaccount 12y agoYou don't achieve freedom through bad software. What the hell? Note that the NSA spying on you is also facilitated by all the complex, buggy, broken software we use.