← Back to context

Comment by 0x457

2 days ago

I keep saying that no one should be using alpine or musl, but people keep replying that static linking is totally worth it.

both alpine and musl are great in my opinion, and as far as I know theres no empirical evidence that it is more or less secure overall than alternatives. would you like to elaborate your opinion?

  • More evidence than allowing root to log in with any long password?

    • I have to admit that I am a bit disappointed in this kind of thinking. There's vulnerabilities everywhere as especially the past few weeks have shown.

      One occurrence is not a statistic and should not be used as evidence - it's just an example of a vulnerability that due to various bad circumstances lead to a particularity bad outcome. This logic is in my opinion equally flawed as calling alpine safe now because this particular vulnerability has been fixed.

      I'm not a big fan of blaming and I think it's just a result of bad circumstances, but it's interesting to see how some seem to blame musl, but one could argue further that musl documented the behavior of their API which was ignored by openssh and so on

  • IMO only good thing about alpine is that it's a good environment to build stuff that links musl statically.

    Never understood why Alpine is used to actually run anything in a container - if you statically link binary, then you don't need alpine as a base and if you don't what is the point? Don't @ me about image size, even without layer caching we're talking about tiny difference that is often dwarfed by size of your runtime.

    Musl itself is a great example of taking "simple and lightweight" so seriously that everyone else gets to deal with the complexity. Slow allocator, underoptimized memcpy/string routines, limited locale support, no NSS, and endless glibc compatibility headaches.

    But hey, at least libc is small. %%Proceeds to pull in megabytes of <any other>malloc, and other libraries to replace the slow parts of musl.%%

    And now sshhole.com is a particularly spectacular example of what happens when "simple" meets the rest of the software ecosystem.

Static linking makes distribution easier, but it's an absolute security nightmare.

With dynamic linking, you just upgrade the library on your system and you're done. With static linking, every binary that uses the library has to be rebuilt.

  • So then rebuild everything? I don't see the problem. NixOS shows how it's done.

Docker is a static binary and HTTP is a new command line. I don't care what's inside, nothing good anyway.