Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Open Source KDE Software

Are You Sure This Is the Source Code? 311

oever writes "Software freedom is an interesting concept, but being able to study the source code is useless unless you are certain that the binary you are running corresponds to the alleged source code. It should be possible to recreate the exact binary from the source code. A simple analysis shows that this is very hard in practice, severely limiting the whole point of running free software."
This discussion has been archived. No new comments can be posted.

Are You Sure This Is the Source Code?

Comments Filter:
  • Bogus argument (Score:5, Insightful)

    by Beat The Odds ( 1109173 ) on Thursday June 20, 2013 @02:22PM (#44063025)
    "Exact binaries" is not the point of having the source code.
  • by Chrisq ( 894406 ) on Thursday June 20, 2013 @02:24PM (#44063049)
    If you are that paranoid study the source code then recompile
  • touch o' hyperbole (Score:5, Insightful)

    by ahree ( 265817 ) on Thursday June 20, 2013 @02:27PM (#44063099)

    I'd suggest that "severely limiting the whole point of running free software" might be a touch of an exaggeration. A huge touch.

  • by Microlith ( 54737 ) on Thursday June 20, 2013 @02:28PM (#44063123)

    A simple analysis shows that this is very hard in practice, severely limiting the whole point of running free software."

    No it doesn't. The whole point of running free software is knowing that I can rebuild the binary (even if the end result isn't exactly the same) and, more importantly, freely modify it to suit my needs rather than being beholden to some vendor.

  • Re:What a problem (Score:4, Insightful)

    by jedidiah ( 1196 ) on Thursday June 20, 2013 @02:28PM (#44063129) Homepage

    ...or just using a binary that you compiled from binary yourself.

    For a lot of projects, that's not nearly as hard as some people like to make it sound.

  • Not a concern (Score:5, Insightful)

    by gweihir ( 88907 ) on Thursday June 20, 2013 @02:29PM (#44063141)

    If you need to be sure, just compile it yourself. If you suspect foul play, you need to do a full analysis (assembler-level or at least decompiled) anyways.

    The claim that this is a problem is completely bogus.

  • Trust (Score:5, Insightful)

    by bunratty ( 545641 ) on Thursday June 20, 2013 @02:33PM (#44063193)

    I took a graduate-level security class from Alex Halderman (of Internet voting fame) and what I came away with is that security comes down to trust. To take an example, when I walk down the street, I want to stay safe and avoid being run over by a car. If I think that the world is full of crazy drivers, the only way to be safe is to lock myself inside. If I want to function in society, I have to trust that when I walk down the sidewalk that a driver will not veer off the road and hit me.

    When you order a computer, you simply trust that it doesn't have a keylogger or "secret knock" CPU code installed at the factory. It's exactly the same with software binaries, of course. In the extreme case, even examining all the source code will not help [win.tue.nl]. You must trust!

  • Re:Bogus argument (Score:5, Insightful)

    by CastrTroy ( 595695 ) on Thursday June 20, 2013 @02:33PM (#44063207)
    Ok, maybe not exact binaries, but what if you can't even make a binary at all, or if you do make one, how do you ensure it's functioning the same? That's the problem that many people have with open source code that exists in languages that you can only compile with a proprietary compiler. Take .Net for instance. It's possible to write a program that is open source, and yet you're at the mercy of Microsoft to be able to compile the code. Even when I download Linux packages in C, it's often the case that I can't compile them, because I'm missing some obscure library that the original developer just assumed I had. What good is code if you are unable to compile it is right up there with "what use is a phone call, if you are unable to speak". Some code only works with certain compilers, or with certain flags turned on in those compilers. Simply having the source code doesn't mean you have the ability to actually use the source code to make bug fixes should the need arise.
  • Re:Bogus argument (Score:3, Insightful)

    by Anonymous Coward on Thursday June 20, 2013 @02:44PM (#44063309)

    To borrow from The Watchmen:

    Who compiles the compiler?

  • Re:What a problem (Score:5, Insightful)

    by arth1 ( 260657 ) on Thursday June 20, 2013 @02:44PM (#44063319) Homepage Journal

    Has anybody thought about recompiling the source and seeing if you get the same binary?

    Has anybody thought of reading the article before posting questions like this?

    That said, this particular "article" isn't worth the waste of bytes it takes up. It's like seeing a 6 year old trying to explain a combustion engine.

    Binaries will almost always differ - if nothing else because you need the entire environment exactly like the binary builder. Not just the time stamps, compile paths, hostnames and account names, which are the obvious.
    If your compiler or linker is a minor version off what he used, the results can be very different, even if using the same compile options.
    But that's not enough: If your hardware is different, randomization of functions in a library will be different.

    To flesh out his article a bit more, the author could have done a test with two different Gentoo systems. Different but mostly compatible hardware, and a slight difference in the toolchain. That might have opened his eyes.
    Then again, probably not.

  • by Shoten ( 260439 ) on Thursday June 20, 2013 @02:48PM (#44063375)

    A simple analysis shows that this is very hard in practice, severely limiting the whole point of running free software."

    No it doesn't. The whole point of running free software is knowing that I can rebuild the binary (even if the end result isn't exactly the same) and, more importantly, freely modify it to suit my needs rather than being beholden to some vendor.

    There's another point too...which incidentally is the whole point of running a distro like Gentoo...that you can compile the binary exactly to your specifications, even sometimes optimizing it for your specific hardware. I don't get at all this idea he has about "reproducible builds;" if he builds the same way on the same hardware, he'll get the same binary. But what he's doing is comparing builds in distros with ones he did himself...and the odds that it's the same method used to create the binary are very low indeed.

    If he's concerned about precompiled binaries having been tampered with, he's looking at the wrong protective measure. Hashes and/or signing are what is used to protect against that...not distributing the source code alongside the compiled binary files. If you look at the source code and just assume that a precompiled binary must somehow be the same code "just because," you're an idiot.

  • Re:Bogus argument (Score:5, Insightful)

    by ZahrGnosis ( 66741 ) on Thursday June 20, 2013 @02:51PM (#44063417) Homepage

    If you're worried about the lineage of a binary then you need to be able to build it yourself, or at least have it built by a trusted source... if you can't, then either there IS a problem with the source code you have, or you need to decide if the possible risk is worth the effort. If you can't get and review (or even rewrite) all the libraries and dependencies, then those components are always going to be black-boxes. Everyone has to decide if that's worth the risk or cost, and we could all benefit from an increase in transparency and a reduction in that risk -- I think that was the poster's original point.

    The real problem is that there's quite a bit of recursion... can you trust the binaries even if you compiled them, if you used a compiler that came from binary (or Microsoft)? Very few people are going to have access to the complete ground-up builds required to be fully clean... you'd have to hand-write assembly "compilers" to build up tools until you get truly useful compilers then build all your software from that, using sources you can audit. Even then, you need to ensure firmware and hardware are "trusted" in some way, and unless you're actually producing hardware, none of these are likely options.

    You COULD write a reverse compiler that's aware of the logic of the base compiler and ensure your code is written in such a way that you can compile it, then reverse it, and get something comparable in and out, but the headache there would be enormous. And there are so many other ways to earn trust or force compliance -- network and data guards, backups, cross validation, double-entry or a myriad of other things depending on your needs.

    It's a balance between paranoia and trust, or risk and reward. Given the number of people using software X with no real issue, a binary from a semi-trusted source is normally enough for me.

  • Re:What a problem (Score:5, Insightful)

    by TheRaven64 ( 641858 ) on Thursday June 20, 2013 @02:52PM (#44063421) Journal

    Most of the time, even that isn't enough. C compilers tend to embed build-time information as well. For verilog, they often use a random number seed for the genetic algorithm for place-and-route. Most compilers have a flag to set a specified value for these kinds of parameter, but you have to know what they were set to for the original run.

    Of course, in this case you're solving a non-problem. If you don't trust the source or the binary, then don't run the code. If you trust the source but not the binary, build your own and run that.

  • Re:Bogus argument (Score:5, Insightful)

    by icebike ( 68054 ) on Thursday June 20, 2013 @02:54PM (#44063457)

    But too his credit, he did say a "simple analysis" although when reading TFA he omitted the word "minded" from the middle of that phrase.

    Virtually all of his findings are traced to differences in date and time and chosen compiler settings and compiler vintage.
    Unless he can find large blocks of inserted code (not merely data segment differences) he is complaining about nothing.

    He his certainly free to compile all of his system from source, and that way he could be assured he is running
    exactly what the source said. But unless and until he reads AND UNDERSTANDS every line of the source he is
    always going to have to be trusting somebody somewhere.

    Its pretty easy to hide obfuscated functionality in a mountain of code (in fact it seems far too many programmers pride
    themselves their obfuscation skills). I would worry more about the mountain he missed while staring at the
    mole-hill his compile environment induced.

  • Re:Bogus argument (Score:5, Insightful)

    by oGMo ( 379 ) on Thursday June 20, 2013 @03:00PM (#44063547)

    Simply having the source code doesn't mean you have the ability to actually use the source code to make bug fixes should the need arise.

    And yet, it still means that you can fix it, or even rewrite it in something else, if you want. Not having the source code means this is between much-more-difficult and impossible. The lesson here should be that everything we use should be open source, including compilers and libraries, not "well in theory I might have problems, so screw that whole open source thing .. proprietary all the way!"

  • Re:Bogus argument (Score:4, Insightful)

    by CastrTroy ( 595695 ) on Thursday June 20, 2013 @03:01PM (#44063555)
    I'm not really even talking from a trust point of view, but more the other point of open source software, which is, "if there's a bug in the code, you can fix it yourself". Without even going down that whole tangent of recursively verifying the entire build chain, there's the problem of being able to even functionally compile the source code so that you can make fixes when you need to.
  • Re:Bogus argument (Score:4, Insightful)

    by UnknownSoldier ( 67820 ) on Thursday June 20, 2013 @03:59PM (#44064173)

    Exactly.

    I've recompiled Vim because I wanted to fix Vim's broken design of being unable to distinguish between TAB and Ctrl-I, doesn't support CapsLock remap, and wanted a smaller executable not needing all the bells and whistles of the kitchen sink.

    I've recompiled Notepad++ due to bug (couldn't select a font smaller then 8 pts because the array was hard-coded in two different places. WTF?)

    If you want to be able to quickly tell the quality of an open source project, see how easy it is to follow the directions to even produce an executable. Most open source projects have shitty docs on how to even compile it.

  • Re:Bogus argument (Score:4, Insightful)

    by donaldm ( 919619 ) on Thursday June 20, 2013 @06:58PM (#44065739)

    There are very talented people that can hide things in only a few lines of code. See http://ioccc.org/ [ioccc.org] for some examples that will make your skin crawl.

    True, but any programmer that works in a Professional way should document their code so that it is maintainable. Those programmers that think that their code should be hard to read because that is a good way of keeping their job eventually come down to earth with a thud when their manager tells them that "The door is over there, please watch your fingers on the way out". Usually hard to read code is thrown out and a fresh start is made since it sometimes is so much quicker to do this especially if the System Designer (not the programmer) has documented the concept properly. On a more serious note companies that don't have well documented overview design and code are asking for trouble down the time line.

Work without a vision is slavery, Vision without work is a pipe dream, But vision with work is the hope of the world.

Working...