this post was submitted on 01 Apr 2024
5 points (100.0% liked)

Linux

66373 readers
435 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
all 23 comments
sorted by: hot top controversial new old
[–] Aatube@kbin.melroy.org 2 points 2 years ago (4 children)

Don't forget all of this was discovered because ssh was running 0.5 seconds slower

[–] imsodin@infosec.pub 2 points 2 years ago

Technically that wasn't the initial entrypoint, paraphrasing from https://mastodon.social/@AndresFreundTec/112180406142695845 :

It started with ssh using unreasonably much cpu which interfered with benchmarks. Then profiling showed that cpu time being spent in lzma, without being attributable to anything. And he remembered earlier valgrind issues. These valgrind issues only came up because he set some build flag he doesn't even remember anymore why it is set. On top he ran all of this on debian unstable to catch (unrelated) issues early. Any of these factors missing, he wouldn't have caught it. All of this is so nuts.

[–] Steamymoomilk@sh.itjust.works 1 points 2 years ago (1 children)

Its toooo much bloat. There must be malware XD linux users at there peak!

[–] rho50@lemmy.nz 3 points 2 years ago* (last edited 2 years ago) (1 children)

Tbf 500ms latency on - IIRC - a loopback network connection in a test environment is a lot. It's not hugely surprising that a curious engineer dug into that.

[–] ryannathans@aussie.zone 1 points 2 years ago

Especially that it only took 300ms before and 800ms after

[–] Jolteon@lemmy.zip 1 points 2 years ago (1 children)

Half a second is a really, really long time.

[–] lurch@sh.itjust.works 0 points 2 years ago (1 children)

reminds of Data after the Borg Queen incident

[–] Olgratin_Magmatoe@lemmy.world 0 points 2 years ago (1 children)

Which ep/movie are you referring to?

[–] gravitas_deficiency@sh.itjust.works 0 points 2 years ago (1 children)

The one where they go back in time but the whales were already nuked

[–] luthis@lemmy.nz 1 points 2 years ago

I... actually can't tell if you're taking the piss or if that's a real episode.

I have so many questions about the whales.

[–] oce@jlai.lu 0 points 2 years ago (1 children)

Is that from the Microsoft engineer or did he start from this observation?

[–] whereisk@lemmy.world 0 points 2 years ago (1 children)

From what I read it was this observation that led him to investigate the cause. But this is the first time I read that he's employed by Microsoft.

[–] Quill7513@slrpnk.net 0 points 2 years ago (1 children)

I've seen that claim a couple of places and would like a source. It very well may be since Microsoft prefers Debian based systems for WSL and for azure, but its not something I would have assumed by default

[–] merthyr1831@lemmy.world 2 points 2 years ago (2 children)

I know this is being treated as a social engineering attack, but having unreadable binary blobs as part of your build/dev pipeline is fucking insane.

[–] suy@programming.dev 1 points 2 years ago

Is it, really? If the whole point of the library is dealing with binary files, how are you even going to have automated tests of the library?

The scary thing is that there is people still using autotools, or any other hyper-complicated build system in which this is easy to hide because who the hell cares about learning about Makefiles, autoconf, automake, M4 and shell scripting at once to compile a few C files. I think hiding this in any other build system would have been definitely harder. Check this mess:

  dnl Define somedir_c_make.
  [$1]_c_make=`printf '%s\n' "$[$1]_c" | sed -e "$gl_sed_escape_for_make_1" -e "$gl_sed_escape_for_make_2" | tr -d "$gl_tr_cr"`
  dnl Use the substituted somedir variable, when possible, so that the user
  dnl may adjust somedir a posteriori when there are no special characters.
  if test "$[$1]_c_make" = '\"'"${gl_final_[$1]}"'\"'; then
    [$1]_c_make='\"$([$1])\"'
  fi
  if test "x$gl_am_configmake" != "x"; then
    gl_[$1]_config='sed \"r\n\" $gl_am_configmake | eval $gl_path_map | $gl_[$1]_prefix -d 2>/dev/null'
  else
    gl_[$1]_config=''
  fi
[–] nxdefiant@startrek.website 1 points 2 years ago* (last edited 2 years ago) (1 children)

It's not uncommon to keep example bad data around for regression to run against, and I imagine that's not the only example in a compression library, but I'd definitely consider that a level of testing above unittests, and would not include it in the main repo. Tests that verify behavior at run time, either when interacting with the user, integrating with other software or services, or after being packaged, belong elsewhere. In summary, this is lazy.

[–] inetknght@lemmy.ml 0 points 2 years ago (1 children)

and would not include it in the main repo

Tests that verify behavior at run time belong elsewhere

The test blobs belong in whatever repository they're used.

It's comically dumb to think that a repository won't include tests. So binary blobs like this absolutely do belong in the repository.

[–] nxdefiant@startrek.website 1 points 2 years ago* (last edited 2 years ago) (1 children)

A repo dedicated to non-unit-test tests would be the best way to go. No need to pollute your main code repo with orders of magnitude more code and junk than the actual application.

That said, from what I understand of the exploit, it could have been avoided by having packaging and testing run in different environments (I could be wrong here, I've only given the explanation a cursory look). The tests modified the code that got released. Tests rightly shouldn't be constrained by other demands (like specific versions of libraries that may be shared between the test and build steps, for example), and the deploy/build step shouldn't have to work around whatever side effects the tests might create. Containers are easy to spin up.

Keeping them separate helps. Sure, you could do folders on the same repo, but test repos are usually huge compared to code repos (in my experience) and it's nicer to work with a repo that keeps its focus tight.

It's comically dumb to assume all tests are equal and should absolutely live in the same repo as the code they test, when writing tests that function multiple codebases is trivial, necessary, and ubiquitous.

[–] balp@lemmy.world 0 points 2 years ago (1 children)

It's also easier to work if one simple git command can get everything you need. There is a good case for a bigger nono-repo. It should be easy to debug tests on all levels else it's hard to fix issues that the bigger tests find. Many new changes in git make the downsides of a bigger repo less hurtful and the gains now start to outweigh the losses of a bigger repo.

[–] Hexarei@programming.dev 1 points 2 years ago (1 children)

A single git command can get everything for split repos if you use submodules

[–] balp@lemmy.world 1 points 2 years ago

I would say yes and no, but yes the clone command can do it. But branching and CI get a bit more complicated. Pushing and reviewing changes gets more complicated to get the overview. If the functionality and especially the release cycle is different the submodules still have great values. As always your product and repo structure is a mix of different considerations and always a compromise. I think the additions in git the last years have made the previous really bad pain points with bigger repos less annoying. So that I now see more situations it works well.

I always recommend keeping all testing in the same repo as the code that affects the tests. It keeps tracking changes in functionality easier, needing to coordinate commits, merging, and branches in more than one repo is a bigger cognitive load.