News for hackers. Stuff that matters.
Re:Stali: A new static Linux distribution by paulddraper on Wednesday September 28, 2016 @12:26AM (#12595417)
I really like the idea of static linking.

Then I think about how I'd patch the next inevitable openssl bug.

Then I don't like it as much.

Re:Stali: A new static Linux distribution by 4ad on Wednesday September 28, 2016 @04:23AM (#12596179)
It's a complete fallacy that every program that needs crypto needs to link to crypto libraries. Look at how Plan 9 does it, where everything is statically linked, but it's other processes which do crypto. Replace only one binary, and the crypto is fixed for all binaries.
Re:Stali: A new static Linux distribution by Annatar on Wednesday September 28, 2016 @05:12AM (#12596353)
shared object libraries are exactly that, a special case of an ELF executable. Special, in the sense that they are not directly executable by users on the command line, other than that, there is no difference (as regular ELF executables can be compiled as re-entrant, position independent code just like shared object libraries).
Re:Stali: A new static Linux distribution by __david__ on Wednesday September 28, 2016 @02:30PM (#12600063)
Not exactly the same—shared libs don't have process isolation like an external crypto process would.
Re:Stali: A new static Linux distribution by paulddraper on Wednesday September 28, 2016 @11:02AM (#12598167)
Yeah, definitely a po-ta-to distinction.

The real difference between static and dynamic linking is self-contained vs. external dependencies. This dependency can be actual "linking" or it can be inter-process; I don't think that changes the equation.

Re:Stali: A new static Linux distribution by ackalker on Thursday September 29, 2016 @01:56AM (#12603524)
Interesting fact: while not all shared object files are executable (or rather: do something interesting other than dump core), some most definitely are: try executing libc someday: $ /usr/lib/libc.so.6

See http://stackoverflow.com/questions/1449987/building-a-so-tha... for more information.

Re:Stali: A new static Linux distribution by ex_amazon_sde on Wednesday September 28, 2016 @05:04AM (#12596313)
Most Linux distributions are not going to have enough hardware to rebuild large fractions of their packages when a vulnerability is found in a popular library in a reasonable time. Also, many users will be unhappy to download gigabytes of updates when this happens instead of few megs. (Not every organization runs an internal mirror and not every user sits on a 1GBit pipe)

This would lead to very slow security updates for the end users.

Re:Stali: A new static Linux distribution by artificial on Thursday September 29, 2016 @12:23AM (#12603289)
Chrome makes use of binary patching. Just the deltas are sent. Originally they used bsdiff and ended up implementing their own (superior) version. https://blog.chromium.org/2009/07/smaller-is-faster-and-safe...
Re:Stali: A new static Linux distribution by qznc on Wednesday September 28, 2016 @06:28AM (#12596608)
I guess the "suckless" answer would be to not use OpenSSL.
Re:Stali: A new static Linux distribution by spoiler on Wednesday September 28, 2016 @07:28AM (#12596853)
Who knows, we might soon get SuckleSSL. :)

Jokes aside, they have a bizarre philosophy and attitude, especially when you consider their software is most of the time buggy, and… Well, sucky.

Re:Stali: A new static Linux distribution by degobah on Wednesday September 28, 2016 @10:52AM (#12598094)
It's hard to take them seriously when they include statements like this on their FAQ: "Of course Ulrich Drepper thinks that dynamic linking is great, but clearly that’s because of his lack of experience and his delusions of grandeur."
Re:Stali: A new static Linux distribution by JdeBP on Wednesday September 28, 2016 @07:42AM (#12596913)
Per http://suckless.org/rocks you appear to have guessed correctly.
Re:Stali: A new static Linux distribution by hollerith on Wednesday September 28, 2016 @09:28AM (#12597419)
OK, then same question about whatever SSL library it does use.
Re:Stali: A new static Linux distribution by giovannibajo1 on Wednesday September 28, 2016 @01:02AM (#12595521)
You'd run "pkg-manager upgrade", just like you do with dynamic linking.
Re:Stali: A new static Linux distribution by jtietema on Wednesday September 28, 2016 @01:10AM (#12595549)
Yep but now instead of fetching 1 updated library, you depend on everybody and their cat to rebuild their binaries and publish updated versions.
Re:Stali: A new static Linux distribution by giovannibajo1 on Wednesday September 28, 2016 @06:10AM (#12596543)
Not really, I depend on my distro to push updated packages that I will update. And I also hope that my distro pushes me binary diffs so that it's going to be very fast.

The point is: in the context of a Linux distro, it's not true that you need dynamic linking to be able to do security patches effectively. What users do is to run the package manager to update the system; the package manager can provide updates to static binaries as well (and do it efficiently). It's just a matter of tooling; current package managers are designed around the concept of dynamic libraries, but they could be updated.

Re:Stali: A new static Linux distribution by jstimpfle on Wednesday September 28, 2016 @10:12AM (#12597734)
Is it practical to make diffs of recompiled binaries? Don't you need to compile to position independent code? Or otherwise make sure that most of the code's position does not change when some statically linked library changes?
Re:Stali: A new static Linux distribution by jdc0589 on Wednesday September 28, 2016 @10:33AM (#12597932)
Slightly different comparison, but I remember some google project to do this for shipping updates a while ago. Must have been for android, but I can't remember.
Re:Stali: A new static Linux distribution by infogulch on Wednesday September 28, 2016 @10:57AM (#12598131)
Chrome, actually. Called Courgette [1]. This would actually be really awesome to apply to statically-linked distro updates.

[1]: https://www.chromium.org/developers/design-documents/softwar...

Re:Stali: A new static Linux distribution by wscott on Wednesday September 28, 2016 @06:21AM (#12596584)
There is no reason binaries have to be downloaded completely. They can be patched. And we can use rabin fingerprinting for deduplicating to not send duplicate blocks for each binary. Also, don't forget Chrome's approach of patching the disassembly of a binary. https://www.chromium.org/developers/design-documents/softwar...
Re:Stali: A new static Linux distribution by smegel on Wednesday September 28, 2016 @02:06AM (#12595743)
You would thing a distro like this would be more like gentoo...you recompile stuff as needed (which for openssl means almost everything).
Re:Stali: A new static Linux distribution by cheiVia0 on Wednesday September 28, 2016 @08:07AM (#12597022)
Gentoo is dynamically linked, so you only recompile if there's an ABI break - a major version - not a patch/minor release. And, you only recompile the stuff that directly links to it.

With static linking, you literally need to recompile everything that uses the library in any form, for every single change. So of there's a security fix in openssl and LibreOffice uses openssl, you need to recompile LibreOffice. If QEMU uses libssh2 which uses openssl, you need to recompile QEMU, even though it doesn't use openssl directly. With Gentoo you just recompile openssl and that's it.

And if there a fix to glibc, you need to recompile EVERYTHING because everything would be statically linked to it.

Re:Stali: A new static Linux distribution by ngrilly on Wednesday September 28, 2016 @05:34PM (#12601550)
You don't have to recompile everything. If your system keeps a cache of object files, you only have to relink everything, which is quicker.
Re:Stali: A new static Linux distribution by talideon on Wednesday September 28, 2016 @07:58AM (#12596984)
This is why binary patching exists: http://www.daemonology.net/bsdiff/
Re:Stali: A new static Linux distribution by kleiba on Wednesday September 28, 2016 @02:50AM (#12595881)
You mean "git update":

  * Upgrade/install using git, no package manager needed
How exactly this is going to work, I don't know.
Re:Stali: A new static Linux distribution by anon4711 on Wednesday September 28, 2016 @06:09AM (#12596541)
You probably mean `git fetch` or `git pull`. There is no `git update` in the default feature set.
Re:Stali: A new static Linux distribution by mrweasel on Wednesday September 28, 2016 @03:25AM (#12595984)
I like static linking, for some thing. Web applications is something I would really like to be just a statically linked binary, simply because it would enable you to chroot the application easily.
Re:Stali: A new static Linux distribution by vog on Wednesday September 28, 2016 @05:29AM (#12596418)
Indeed, static linking is very handy for deploying web services. Moreover, the trend with docker and similar technologies is that you deploy a whole new VM image.

That could be considered "static linking", too, because even if it uses shared libraries within the VM image, the image is always replaced as a whole - in those systems you do not replace just a single library within the running image.

If you go even further, you finally reach concepts like MirageOS, where not only the libraries are statically linked into the application, but the whole kernel as well. That way, you have exactly the code you need within your VM, nothing more.

Re:Stali: A new static Linux distribution by qznc on Wednesday September 28, 2016 @06:37AM (#12596652)
We could use binary patches to reduce download size. SuSE did (does?) it.
Re:Stali: A new static Linux distribution by dsr_ on Wednesday September 28, 2016 @06:53AM (#12596718)
This is a win if and only if there is a fast, competent, reliable security team for the distro.

Suckless doesn't currently have that capability, so... it's not a win, yet.