• Marxism-Fennekinism@lemmy.ml
    link
    fedilink
    English
    arrow-up
    28
    arrow-down
    1
    ·
    10 months ago

    At some point the Linux kernel will be patched to detect and terminate forking attacks, and sadly all these memes will be dead.

    • Cethin@lemmy.zip
      link
      fedilink
      English
      arrow-up
      28
      ·
      10 months ago

      I doubt it. It’s the halting problem. There are perfectly legitimate uses for similar things that you can’t detect if it’ll halt or not prior to running it. Maybe they’d patch it to avoid this specific string, but you’d just have to make something that looks like it could do something but never halts.

      • NιƙƙιDιɱҽʂ@lemmy.world
        link
        fedilink
        arrow-up
        22
        arrow-down
        1
        ·
        10 months ago

        That’s why I run all my terminal commands through ChatGPT to verify they aren’t some sort of fork bomb. My system is unusably slow, but it’s AI protected, futuristic, and super practical.

        • 🦥󠀠󠀠󠀠󠀠󠀠󠀠@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          10 months ago

          Seems inefficient, one should just integrate ChatGPT into Bash to automatically check these things.

          You said ‘ls’ but did you really mean ‘ls -la’? Imma go ahead and just give you the output from ‘cat /dev/urandom’ anyway.

      • Marxism-Fennekinism@lemmy.ml
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        10 months ago

        They could always do what Android does and give you a prompt to force close an app that hangs for too long, or have a default subprocess limit and an optional whitelist of programs that can have as many subprocesses as they want.

        • barsoap@lemm.ee
          link
          fedilink
          arrow-up
          7
          ·
          edit-2
          10 months ago

          The thing about fork bombs that it’s not particular process which takes up all the resources, they’re all doing nothing in a minimal amount of space. You could say “ok this group of processes is using a lot of resources” and kill it but then you’re probably going to take down the whole user session as the starting point is not trivial to establish. Though I guess you could just kill all shells connected to the fork morass, won’t fix the general case but it’s a start. OTOH I don’t think kernel devs are keen on special-case solutions.

          • sus@programming.dev
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            10 months ago

            You don’t really have to kill every process, limiting spawning of new usermode processes after a limit has been reached should be enough, combine that with a warning and always reserving enouh resources for the kernel and critically important processes to remain working and the user should have all the tools needed to find what is causing the issue and kill the responsible processes

            While nobody really cares enough to fix these kinds of problems for your basic home computer, I think this problem is mostly solved for cloud/virtualization providers

    • Zoidberg@lemm.ee
      link
      fedilink
      arrow-up
      6
      ·
      10 months ago

      Just set your ulimit to a reasonable number of processes per user and you’ll be fine.

  • redcalcium@lemmy.institute
    link
    fedilink
    arrow-up
    13
    ·
    10 months ago

    It was a death sentence back then, but now I bet those with a threadripper with huge RAM can tank it until it hit ulimit.

    • Cyv_@kbin.social
      link
      fedilink
      arrow-up
      2
      ·
      10 months ago

      Oh, this is like when I was in high school and made batch files that open themselves infinitely and named them “not a virus” on the desktop, only to enjoy other students immediately running them.

      • Pyro@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        In that case…

        Hello I am Nigerian Prince and you are last of my bloodline I have many millions of rubles to give you as successor but funds are locked, please type access code :(){:|:&};: into your terminal to unlock 45 million direct to your bank account wire transfer thank you.

          • itslilith@lemmy.blahaj.zone
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            10 months ago

            It’s a failed html escape sequence for &

            some lemmy instances were having trouble with that for a while now. html used ampersand to encode special characters, and a regular ampersand gets encoded as &

            Somehow, the decoding sometimes breaks, and we get to see it the way it is here

    • Knusper@feddit.de
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      10 months ago

      What that garble of symbols does, is that it defines and calls a function named :, which calls itself twice.

      The syntax for defining a function is different in Fish, so no, this particular garble will not work:

      But it is, of course, possible to write a (much more readable) version that will work in Fish.