Slashdot Mirror


Some Linux Distros Found Vulnerable By Default

TuringTest writes "Security Focus carries an article about a security compromise found on several major distros due to bad default settings in the Linux kernel. 'It's a sad day when an ancient fork bomb attack can still take down most of the latest Linux distributions', says the writer. The attack was performed by spawning lots of processes from a normal user shell. Is interesting to note that Debian was not among the distros that fell to the attack. The writer also praises the OpenBSD policy of Secure by Default."

128 of 541 comments (clear)

  1. Fork vulnerability by madaxe42 · · Score: 5, Funny

    Kittens are vulnerable to forks by default as well - you can easily get at the kernel if you just - oh, hang on, a different kind of fork, you say?

  2. Thank god I use Windows by Anonymous Coward · · Score: 5, Funny

    Thank god I use Windows, I'm safe!

    1. Re:Thank god I use Windows by rokzy · · Score: 5, Funny

      only if you're running XP Starter Edition!

    2. Re:Thank god I use Windows by LiquidCoooled · · Score: 5, Funny

      No, with XP starter, you are restricted to running only 3 trojans at once.

      --
      liqbase :: faster than paper
    3. Re:Thank god I use Windows by rudabager · · Score: 3, Interesting

      put this in notepad, save it as kill.bat then run it

      cmd
      cmd
      cmd
      cmd
      cmd
      cmd
      cmd
      cmd
      cmd
      cmd
      cmd
      kill.bat
      kill.bat
      kill.bat

      I can drop my ath 2000 512mb system in say oh 10 seconds. Increase the amount of cmd's and kill.bat's for added effect :)

      --
      If I wanted easy I wouldnt be an engineer or a patriot.
    4. Re:Thank god I use Windows by anakin357 · · Score: 5, Funny
      No, with XP starter, you are restricted to running only 3 trojans at once.

      Possible obvious responses:

      Only 3 trojans? I'm a self-replicating-trojan author you insensitive clod.

      So I can only run three instances of Internet Explorer at once?

      Customer: Whenever I try to start a second program, it gives me an error...
      Techie: Yeah, you can't run Gator, Precision Time, Weatherbug AND something else... you've gotta turn something off.
      Customer: (incredulous)WHAT!!?? I NEED TO KNOW WHAT TIME IT IS, SAVE MY PASSWORDS, AND KNOW WHAT THE WEATHER IS LIKE OUTSIDE.
      Techie: (mutes customer): "Fucking Chuck Noris, all those goddamn ninjas had to go after the pirates."

      --
      http://www.fsckin.com/
    5. Re:Thank god I use Windows by soconnor99 · · Score: 5, Informative

      You can put a hundred kill.bat's in there but they never get called. It will transfer control, you need to use "call kill.bat" if you want to continue in the same script.

    6. Re:Thank god I use Windows by _xeno_ · · Score: 3, Informative

      That won't work, because "cmd" runs the new process and then waits for it to complete. So you'll wind up with new CMDs every time you type "EXIT" but that's about it.

      You want something like:

      CMD /K KILL.BAT
      KILL.BAT

      Which, on Windows XP at least, also didn't work. I've got it running in the background right now, so if you see this comment, it failed to bring my system down.

      --
      You are in a maze of twisty little relative jumps, all alike.
    7. Re:Thank god I use Windows by joxeanpiti · · Score: 3, Interesting

      Easy to modify the "fork bomb" script for Windows.

      start cmd
      start cmd
      start cmd
      start cmd
      start cmd
      start cmd
      start cmd
      start cmd
      start cmd
      start kill.bat
      start kill.bat
      start kill.bat
      start kill.bat
      start kill.bat
      start kill.bat

      Try it! My machine has been freezed in about 15 seconds.

  3. Sheesh, it's a fork bomb by gowen · · Score: 4, Insightful

    Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug. Inability to turn that feature off would be a bug, but given that few modern Linux boxes are actually used as multi-user remote-login accounts, it's a completely unecessary overhead.

    And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    1. Re:Sheesh, it's a fork bomb by Anonymous Coward · · Score: 3, Insightful

      And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

      Hope you're not administrating any multi-user Linux boxes then, since in Linux, the quotas only deal with drive space ;)

    2. Re:Sheesh, it's a fork bomb by gowen · · Score: 4, Informative

      Sorry, brain fart. I meant hard ulimits

      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    3. Re:Sheesh, it's a fork bomb by CaymanIslandCarpedie · · Score: 4, Insightful

      Sounds much like the same reasoning MS used to use for having defaults set to a "user-friendly" setting.

      Now that its been found in Linux, its a "feature" ;-)

      Come on, I love Linux but the hypocrocy is a bit much ;-) Its OK to admit it was bad or admit MS's settings were OK, but you cannot do both.

      --
      "reality has a well-known liberal bias" - Steven Colbert
    4. Re:Sheesh, it's a fork bomb by woginuk · · Score: 3, Insightful

      I don't know about how it works nowadays. But when I was new to UNIX, I would write the following program:
      int main() {
      while(1)
      fork() ;

      return 0 ;
      }
      Compiling and running it would hang the box. You could ping the system, but nothing else would would work.

      Ultimately, I would have to switch the box off and on again. And I remember thinking that this was a bug.

      A user should be allowed to do whatever he/she wants. But if the system becomes unusable, surely it is a bug.

    5. Re:Sheesh, it's a fork bomb by gowen · · Score: 2, Insightful
      I love Linux but the hypocrocy is a bit much. Its OK to admit it was bad or admit MS's settings were OK, but you cannot do both.
      There's no hypocrisy, at least not from me. I've never criticised MS software because local users are able to fill up disk space, spawn a zillion processes, suck the processor and generally exhaust the resources... That's what users do, they use up your resources.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    6. Re:Sheesh, it's a fork bomb by gowen · · Score: 2, Interesting
      But if the system becomes unusable, surely it is a bug.
      I run codes *all the time* that cause my system to become completely unresponsive. By running huge numerical simulations without enough physical RAM. I'd be mightily annoyed if the kernel told me I wasn't allowed to do this.

      Users use resources. If an admin wants to starve their untrustworthy users of resources, they can (and, if they've a lot of untrustworthy users, its highly recommended), but there is simply no compelling reason why it should be turned on by default.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    7. Re:Sheesh, it's a fork bomb by kfg · · Score: 4, Insightful

      Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug.

      Sorry, but the ability of a mail reader to automagically run as many programs as it likes is a feature, not a bug.

      The point being that while this may, in some rare cases, be desirable, it shouldn't be the default setting, but rather something that the adminstrator has to enable for that rare user for which it is deemed both necessary and desirable.

      "Able" and "capable of" are not the same thing.

      It shouldn't be the responsibility of the admin to turn on every possible security feature, but rather to turn off only those ones he deems gets in the way of the functioning of his system.

      It's exactly this lacadasical approach to security that has made Windows the hell hole that it is. It certainly puts money in my pocket trying to fix it all, over and over and over again, but I'd far rather be spending my time and earning my money doing something useful.

      Like computing.

      KFG

    8. Re:Sheesh, it's a fork bomb by tlhIngan · · Score: 2, Funny

      int main() {
      while(1)
      fork() ;

      return 0 ;
      }


      On a modern Unix/Unix-like system, you often have Perl. Save yourself the effort of compiling:

      perl -e 'while(1){fork()}'

      One thing I always liked to do was run this for about 1 minute, hit Ctrl-C, and see how long until the kernel finally manages to reap all the child processes and the system returns back to normal. Usually can take anywhere from 30 seconds to a couple of minutes before the system becomes responsive again.

      (It *is* a great way to get impressive loadaverages of 500+ though!).

    9. Re:Sheesh, it's a fork bomb by Xugumad · · Score: 4, Interesting

      And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

      *shuffles nervously* So, out of curiousity, for my.. . err... desktop... how do I stop this exactly? :)

    10. Re:Sheesh, it's a fork bomb by halivar · · Score: 2, Funny

      And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

      Or you can switch back to MS-DOS. Just one process; ultimate security!

    11. Re:Sheesh, it's a fork bomb by gowen · · Score: 2, Interesting
      but there should be "some" way for the system to differentiate between useful processes spawning tasks to achieve a computational goal, vs an abhorrent process run amuck.
      Yes, they're should. But, sadly, that problem is one that is generally considered hard by computer scientists. I didn't follow it closely, but the debates around the heuristics for the Linux kernel out-of-memory process killer tells me that it really isn't easy to do.

      Maybe I'm just biased, because last year, I had a horrible time overcoming some hard-coded limits (on stack size) when trying to run some Fortran code on a SunOS box.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    12. Re:Sheesh, it's a fork bomb by gowen · · Score: 2, Insightful
      You should not allow unprivilged users to fork as many processes as they want.
      You should not allow untrusted users to fork as many processes as they want. However, very few boxes have untrusted users. If yours does, the command you need is ulimit
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    13. Re:Sheesh, it's a fork bomb by gowen · · Score: 5, Informative

      man ulimit

      Specifically ulimit -H -u <number> in their startup file.

      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    14. Re:Sheesh, it's a fork bomb by IDontAgreeWithYou · · Score: 2, Interesting

      I used to work at a university that gave all students, faculty and staff unix accounts. A CS professor told us a story of a CS student in an operating systems course who wrote a program that forked so much they had to reboot the server. When some of the administration found out why the server had to be unexpectedly rebooted they wanted to punish the student, but thankfully the IT guys were able to save him. He definitely should not have had the ability to write such a program. Of course, after hearing this story everyone tried it, it didn't cause any problems.

      --
      Finding other idiots on /. that agree with your opinion doesn't make it any less stupid.
    15. Re:Sheesh, it's a fork bomb by puke76 · · Score: 2, Interesting

      The Gentoo discussion thread, with hard and soft resource limit recommendations, is here.

    16. Re:Sheesh, it's a fork bomb by gowen · · Score: 2, Informative
      You need to make this system wide
      In the sense of /etc/<shell>rc, yes you do. You can always test the username against a blacklist, though.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    17. Re:Sheesh, it's a fork bomb by kfg · · Score: 2, Insightful

      There's a word for admins who trust the users:

      "Fired."

      I don't even trust my own mother on her own network.She loves me for it. Her system stays up.

      KFG

    18. Re:Sheesh, it's a fork bomb by Wybaar · · Score: 2, Interesting
      Everybody makes mistakes. Having a high-but-finite and changeable limit prevents a mistake made by a trusted user from getting out-of-control while still allowing that user to get close to the threshold of control.

      For instance, imagine writing a recursive program to calculate the factorial of a number (note: no error checking included, and I'm letting the kth factorial number for k
      function y = factorial(x)
      if x <= 2
      y = 1;
      else
      y = factorial(x-1) + factorial(x-2);
      end

      Now assume that instead of typing (x-1) in the recursive call on the next to last line, the user types (x+1). If the user calls this with x > 2 and you don't have some limit on the number of recursive calls a function can make, this program will never end (unless you exceed the stack limit, which is not a graceful way to exit.) If there is a limit, the program will hit that limit and error, giving the programmer a chance to catch their typo. If the user really was interested in blowing the stack and they have the authority to change the recursion limit, they can do so if they want ... but they have to explicitly point the recursive gun at their foot and explicitly pull the trigger. They won't get shot accidentally.
      --
      Y|
    19. Re:Sheesh, it's a fork bomb by schon · · Score: 2, Interesting
      You need to make this system wide or the end user WILL change it on you.

      How? I thought by default that you have to be root to change the ulimit (either up or down)
      karl@spanky:~$ uname -a
      Linux spanky 2.4.29 #6 Thu Jan 20 16:30:37 PST 2005 i686 unknown unknown GNU/Linux
      karl@spanky:~$ ulimit -H -u 15000
      -bash: ulimit: max user processes: cannot modify limit: Operation not permitted
      I tried the :(){:|:&};: test on Slackware 10, and it failed - load rose for about 30 seconds, then went back to normal - the command was halted.
    20. Re:Sheesh, it's a fork bomb by Mad+Merlin · · Score: 4, Insightful

      You can set hard limits on the amount of RAM a user may consume, in addition to how many processes they can spawn, as well as a number of other useful things with a trivial amount of effort in Linux, have a look at /etc/security/limits.conf.

    21. Re:Sheesh, it's a fork bomb by JabberWokky · · Score: 2, Interesting
      Thinking about it after my post, I came up with the following criteria for this test on OSes:

      Fail - The OS grinds to a halt and after waiting five minutes, there is no recourse other than cutting power and rebooting.

      Pass (one/a) - The OS grinds, but the user can navigate to a feature (console, Control-ESC in KDE, etc) that allows the user to quickly kill the offending process(es).

      Pass (one/b) - The OS grinds or not, but regardless automatically kills the offending process. I consider this to be a worse level than the following.

      Pass (two) - The OS grinds and automatically offers the user a method to kill the offending process(es). (KDE had something like that at one point. It may still). Sometimes you may want to let it run.

      Pass (three) - The OS does not grind and upon approaching resource limits, offers the user an option to shut down the process or let it run.

      And finally...

      Pass (four) - The OS does not grind and upon approaching resource limits, offers the user an option to increase limits, potentially by moving the process to another machine or allocating more systems to the process. Presumably the migration would be automatic (and transparent) if the resource limits were higher than the local machine.

      Obviously, "user" may be a combination of user and admin in certain cases (multi-user machine, accessing other machines off a local cluster, etc).

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  4. Re:In other news... by woginuk · · Score: 2, Insightful

    That is no reason why the same should be true of Linux. Or any other OS for that matter.

  5. Grep Bomb by cheezemonkhai · · Score: 5, Interesting


    So what would a good limit to the number of processes spawned be?

    I mean what can say what is good for everyone?

    Saying that if you think the fork bomb is good grep bombs are more fun and particularly good for silincing the mass of Quake 3 players in an undergraduate lab:

    'grep foo /dev/zero &' fun about 5 of them and watch the box grind to a screaming halt then eventually recover.

    Oh hang on did i just discover a new exploit :P

    1. Re:Grep Bomb by rtaylor · · Score: 2, Informative

      grep foo /dev/zero &

      This may be a Linux only issue. FreeBSDs grep exits almost immediately, but Suse certainly spins.

      I find this interesting because BSD's grep claims to be GNU Grep version 2.5.1 which is the same version as on my Suse installation.

      Perhaps it's a difference in the way /dev/zero works?

      --
      Rod Taylor
  6. Yawn. by BJH · · Score: 3, Insightful

    So what? Anybody in their right mind would have locked down their box if they're letting third parties access it remotely.

    Running around screaming "FORKBOMB! FORKBOMB! The sky's falling in!" seems to be a common pattern every few years. If you know what you're doing, it's trivial to prevent and if you don't know what you're doing, why are you running a public box?

    1. Re:Yawn. by Taxman415a · · Score: 4, Insightful

      This level of fanboyness is unbelievable. Well actually I should not be surprised, blindness to linux's faults is endemic here on Slashdot.

      The author is not "Running around screaming...", he is simply very surprised that a local user can exhaust a system so easily. Maybe every single admin should think of all n possible security problems every single time they take a box live, but people are human.

      Which one is worse: limits in place by default so that an admin needs to know how to raise them when necessary and the forkbomb would not work, or no limits in place and having to know to set them or else the box can be brought to its knees? Secure by default or free for all.

      I suppose you think every default install should also have telnetd enabled by default because any admin with half a brain should know how to turn that off? Point is admins are fallible, the default should be the lower total risk/cost option. I think which one that is is clear here.

    2. Re:Yawn. by RedBear · · Score: 2, Insightful

      Stability is supposed to be one of the selling points of Linux. What exactly is the benefit in having a default setting that allows any user on any Linux desktop computer to lock up their machine just by starting up some application or script that consumes too many resources? Thanks but no thanks. I want both my server and my personal desktop computer to be able to recover from such things without a hard reboot. Whether they are malicious or just a mistake in some shell script doesn't matter. If it takes down the box, it's bad, and should be disabled by default.

      Nobody in their right mind should be defending a lack of stability in Linux. Those who want to push the box to its absolute limits (and risk a hard lockup) can find out how to activate the options that allow this. It should NEVER be the default to have options active that compromise the stability of a machine so easily. Desktops are just as important as servers in this regard, as far as I'm concerned.

      Linux is supposed to be better than Windows, remember? Raising a valid objection to a default setting capable of causing (or allowing) real-world problems on everyday computer systems is not "running around screaming".

      Oh, and by the way, not everyone on Earth is a trained Linux system administrator, and being a Linux admin isn't a prerequisite to being in one's right mind. There are plenty of perfectly intelligent people who have no idea how to "lock down their box" and never will, just like most people have no idea how to break down a carburator or build a nuclear reactor. Some people have other things to do. If Linux distros want to market to the general public, they should be safe to use by the general public. We're talking about DEFAULTS here that are being used by every person running Linux in general. Not just servers run by Linux gurus. Your statement comes across like saying people who aren't expert car mechanics shouldn't be allowed on public roadways. In other words, a little elitist, don't you think?

  7. Not your usual vulnerability by David's+Boy+Toy · · Score: 5, Informative

    Fork bombs only work if you can log into the system in question. This is a bit lower priority than your usual vulnerabilities which allow outside attacks.

    1. Re:Not your usual vulnerability by Jeff+DeMaagd · · Score: 2, Insightful

      The biggest security problems come from the inside. Other employees can't be trusted just because they work for the same company.

  8. Retarded by 0123456 · · Score: 4, Interesting

    Sorry, but this article seems pretty retarded to me. Windows is insecure because people can use IE bugs to install scumware that takes over your entire machine... Linux is insecure because ordinary users who are legitimately logged into your machine can fork off as many processes as they want? Huh?

    Sure, maybe if you're running a server that allows remote logins, you want to restrict how many processes a user can run. But as a single-user system, I want to be able to run as many processes as I choose, not be restricted by the distribution author's ideas of what's good for me.

    1. Re:Retarded by phasm42 · · Score: 4, Informative

      If you had read the article, you'd have realized that this was not Windows vs Linux. It was a report on how a fork bomb can take down default Linux installs, but not default BSD installs. Also, the article was clearly not concerned about single-user installs, but multi-user. Or if the box is hacked into, this is an extra bit of protection.

      --
      "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
    2. Re:Retarded by 0123456 · · Score: 2, Insightful

      "It was a report on how a fork bomb can take down default Linux installs,"

      Yes, and? I don't care about fork bombs, since I don't run them on my PC... being able to run as many processes as I choose on that PC is a feature, not a flaw. I do care about having scumware remotely installed on my PC through security holes in applications and the operating system, which is a flaw, not a feature.

      Seriously, if you're letting people log onto your PC and run fork bombs, you have far greater problems than a lack of resource limits in the default install.

    3. Re:Retarded by Alioth · · Score: 4, Insightful

      *Any* local exploit is *also* a potential remote exploit (just like the IRC conversation shows). I had someone nearly pwn a box of mine by using an exploit in a buggy PHP script, then trying to elevate privileges through a local exploit.

      Had I not considered local exploits important, I'd have had one nicely hacked box.

    4. Re:Retarded by phasm42 · · Score: 4, Insightful

      Two things: 1. Just because you don't care doesn't mean other people won't care. A lot of people (especially in a business environment) do have more than one person logging. 2. The article is trying to point out something that Linux installs could improve on. That is all.

      --
      "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
    5. Re:Retarded by compass46 · · Score: 2, Insightful

      What about a poorly written program run by you with an unintentional bug that ends up causing this? What about a remote exploit which allows abitrary code execution? Do you inspect every line of code in programs that you use to make sure this isn't going to happen?

      User land programs should not be able to bing an entire system to it's knees. Come on, when I first started with Linux, Slashdotters made fun of Win98 because a single program could crush the machine.

    6. Re:Retarded by Yaztromo · · Score: 2, Insightful
      Yes, and? I don't care about fork bombs, since I don't run them on my PC... being able to run as many processes as I choose on that PC is a feature, not a flaw.

      A fork bomb doesn't necessarily have to be due to a purposeful attack. A software bug can easily cause a fork bomb by going into an endless loop launching new processes. Should this take your system completely down?

      Admittedly, you probably shouldn't bee seeing such a serious bug in any release software. But what if you're a developer, and have code that is forking in a loop which, due to logic problems, never exits? Should you be forced to reboot your system?

      I can think of a lot of such instances where a runaway process might start forking -- and personally, I'd prefer to be able to kill the process instead of being forced to reboot. I doubt if I'm ever going to purposefully spawn 5000 simultaneous processes. I think you'd have a valid complaint if the OS was limiting you to 50 processes, but there is a realistic upper limit of the number of processes a given hardware configuration is going to be able to reliably handle -- why shouldn't the kernel prevent the system from surpassing such a limit? Do you really want to be able to open enough processes to kill your system so badly the only way out is a reboot?

      Yaz.

  9. Debian not vulnerable? by lintux · · Score: 5, Interesting

    I really wonder what kind of Debian installation he runs. Just a couple of weeks ago I had to reboot my Debian box after some experimenting with an obfuscated fork bomb. Won't work again now that I set some ulimits, but they're not there by default.

    In case anyone is interested, here's the obfuscated fork bomb: :(){ :&:;};:

    1. Re:Debian not vulnerable? by jon787 · · Score: 2, Informative

      You were reading bash.org weren't you?

      And yes, my Debian box also fell to that the first time I ran it.

      I put that on the wall of the CS computer lab here for fun, I don't know how many poor souls ran it.

      --
      X(7): A program for managing terminal windows. See also screen(1).
    2. Re:Debian not vulnerable? by initsix · · Score: 3, Funny

      Sweet!
      mark@stewie:~$ w
      11:11:04 up 216 days, 19:50, 2 users, load average: 258.41, 767.84, 339.94

    3. Re:Debian not vulnerable? by spankers · · Score: 2, Informative

      Debian is vulnerable. I am running Unstable and...

      pam_limits is commented out in /etc/pam.d/login and /etc/security/limits.conf has no default user limits:

      eherr@chernobyl:~$ ulimit -a
      core file size (blocks, -c) 0
      data seg size (kbytes, -d) unlimited
      file size (blocks, -f) unlimited
      max locked memory (kbytes, -l) unlimited
      max memory size (kbytes, -m) unlimited
      open files (-n) 1024
      pipe size (512 bytes, -p) 8
      stack size (kbytes, -s) 8192
      cpu time (seconds, -t) unlimited
      max user processes (-u) unlimited
      virtual memory (kbytes, -v) unlimited

  10. Not a vulnerability. by argent · · Score: 5, Insightful

    A forkbomb is just a relatively simplistic way to mount a resource exhaustion attack. I would be extremely wary of anyone who claims that their UNIX class operating system is immune to resource exhaustion from a local user. There's just too many resources that can be commandeered, and to lock them all down would leave you with a system that's so restricted as to be nearly useless as a general computing platform.

    It must be a slow day on /. if they're reporting this as news.

    1. Re:Not a vulnerability. by mOdQuArK! · · Score: 3, Insightful
      I would be extremely wary of anyone who claims that their UNIX class operating system is immune to resource exhaustion from a local user.

      Eh? Most modern UNIX systems let you put some hard limits on all the collective ways that users can consume resources, including # processes, disks space, real/virtual memory, cpu time, etc. Any administrator who is responsible for a multi-user system should have those set to "reasonable" values, and no individual user (except for the administrator of course) would be able to bring down the system.

      What kind of resource are you thinking of that any user can exhaust which would stop the system (through resource exhaustion)? Log file messages?

    2. Re:Not a vulnerability. by Anonymous Coward · · Score: 2, Insightful
      You can always allocate a big chunk of memory and write one byte to each page. The machine will be swapping so hard it would take an hour to log in and figure out which job is the problem. Yes, it doesn't "crash" the system, but unusable is the same as down in my book.

      The grandparent post is right. Absolute security is absolutely unusable. You need to trust your users a little so they can do the work they need to do. If they step over the line most want to know how to avoid doing it again.

    3. Re:Not a vulnerability. by mOdQuArK! · · Score: 2, Insightful
      You can always allocate a big chunk of memory and write one byte to each page.

      That would be caught by the limits on virtual memory usage. As I said, what resource are you thinking of that a decent system administrator couldn't limit to prevent a normal user from exhausting resources?

    4. Re:Not a vulnerability. by greed · · Score: 2, Informative
      I would be extremely wary of anyone who claims that their UNIX class operating system is immune to resource exhaustion from a local user.

      There are some things that Linux responds to in a much worse way than some of the older UNIXes.

      I wrote a fork() bomb at work to demonstrate what a buggy program had just done to one of our Big Sun Machines. It was out of process slots (entirely--because the per-user limit was something like 30,000, and with the number of users on the system with hundreds of unreaped child processes it overloaded the kernel process table).

      while(-1!=fork());

      I've done things like that on AIX machines I was testing in the past, and sure, they get pretty unresponsive and it's hell to kill off; you basically have to switch to that user and carefully kill -9 -1. (Careful to make sure you don't do it as root....) But if you don't try to hide the bomb, CTRL-C eventually goes through.

      It wedged my Linux machine so hard that caps lock stopped responding. (My test for "is it X11 that's dead or the whole kernel".) CTRL-C or CTRL-\ just weren't going to happen... I tried for 15 minutes before hitting the power button.

      And I've got a 4095 per-user process limit. But as fork() starts failing in some processes, other processes get scheduled to try fork() themselves. So you get over 4000 processes all trying to fork() at once, and nothing else gets time on the CPU.

      A different scheduling algorithm could mitigate some of the impact of a forkbomb on Linux. Similar to the way Linux will dump all its VM pages in favor of allocating them to disk buffers; Linux's approach to some things may be great for performance, but can make things worse when things go wrong.

    5. Re:Not a vulnerability. by Nevyn · · Score: 2, Interesting
      • Sendmail -- most BSDs use it ... craps itself under load, and is a major PITA to cleanup the queue.
      • Attach the disks, have multiple procs read/writting data as fast as possible (you don't need much disk space, writting small files is fine).
      • Using recursive SCM_RIGHTS to use huge numbers of PF_LOCAL sockets (it isn't accounted after SCM_RIGHTS).
      • Find a simple setuid() app. and fork/exec bomb to that.
      • BIND is fairly simple to DOS attack from the local machine.
      • HTTP is also likely to be easy to DOS, due to needing 1 proc per connection ... where you, as the attacker, don't need anything like that.
      • portmap almost always doesn't do any auth checks on assign X service to Y port calls ... so that would easily take out NFS, FAM and/or any other RPC services you are running (re-direct the ports to HTTP for even more fun).
      • Run something like: (while :; do; mkdir a; cd a; done) ... takes out more than a few directory walking applications (often including backups).

      There's probably some more obvious ones, if I thought about it a bit.

      I guess I wouldn't mind if Fedora came with defauts that stopped a forkbomb on my box, if I was stupid enough to run one ... but if they fucked it up and set it too low I guarantee I'd be very pissed.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
  11. Re:In other news... by oscartheduck · · Score: 5, Insightful

    No, I understand the article. I just couldn't resist the jab. The fact is that GNU/Linux ought to be the best it can be in and of itself. That some distributions are screwing that up and making very poor defaults is not to be forgiven. Not at all. Especially when it isn't difficult to do better.

    --
    How to use coral cache: http://slashdot.org.nyud.net:8090/~oscartheduck
  12. And of course, shell access is so easy to get by n0dalus · · Score: 5, Insightful

    On the 3 distros listed as vulnerable, the default settings would stop any remote person from having a chance of getting a shell open on the box to perform the fork attack in the first place.
    If a person has enough access to the machine to be able to "forkbomb" it, then there's plenty of other nasty things you could do to it.

  13. Re:How long? by biendamon · · Score: 2, Funny

    Let's see how long it will take before someone says the study is invalid...

    The study is invalid!!!

  14. "Secure By Default"? by EXTomar · · Score: 3, Interesting

    Doesn't OpenBSD still install 'ftpd' by default? Although it is not turned 'on', the fact is it is still on the file system ready for exploit and requires rigoriously patched unless you take steps to remove it. Doesn't this seem like a dubious definition?

    I'm all for making special install kernels and distros "out of the box" to be as hardened as possible. I would love see many distros do a "paranoid" configuration. There are plenty of things OpenBSD does right but that does not excuse OpenBSD. Just like Linux and every other operating system out there, they can still strive to do better.

    1. Re:"Secure By Default"? by ArbitraryConstant · · Score: 4, Interesting

      Please explain how the ftpd binary (not suid) can be used to exploit the system in ways that the user otherwise could not.

      Taking away the ftpd binary wouldn't stop the user from doing exactly the same thing by some other means. For example, they could simply download the source and compile a new one by themselves. Or use Perl. Or compile a binary somewhere else and download that.

      --
      I rarely criticize things I don't care about.
    2. Re:"Secure By Default"? by binand · · Score: 2, Insightful

      OpenBSD does not install wu-ftpd. Instead, they have their own ftpd, called ftpd-BSD (which has been ported to Linux as well, look it up on rpmfind or something). It is wu-ftpd that has a reputation of being buggy.

    3. Re:"Secure By Default"? by halber_mensch · · Score: 2, Funny

      Clearly, OpenBSD should re-evaluate its install process. The fact that OpenBSD installs so many exploitable executables like "ftpd", "telnet", "ping", "sed", "awk", "more", "grep", "ls", "mv", "sh", "getty" and "init" only details just how insecure the operating system really is by default. This kind of oversight should simply not be allowed. Yes, some old folks in the community may argue that some of these binaries that are piggy-backed on the operating system are "essential tools" for "interacting with the system", but those poor souls would be overlooking the seriously dangerous nature that allowing executable binaries to install on a live system presents.

      --
      perl -e "eval pack(q{H*},join q{},qw{70 72696e74207061636b28717b482a7d2c717b343 637323635363534323533343430617d293b})"
  15. New Plug Vulnerability found! by Anonymous Coward · · Score: 5, Funny

    Unprivileged user can take down entire system by unplugging machine from power socket.

  16. And in other news... by flumps · · Score: 2, Funny

    ... some birds fly south for the winter, my belly sometimes makes gurgling noises and jam tastes nice on toast.

    So what? Publish the vunerabilities, patch them, move on. Sheesh..

    --
    "So there he is, risen from the dead. Like that fella, E. T." - Father Ted Crilly
  17. Wrong attitude. by Anonymous Coward · · Score: 5, Insightful

    All my servers have multiple users. Those users are system accounts to run different software, and I do not want any of them to be able to cause a problem to the entire server. Reasonable limits should be in place by default, and those of us who actually need higher limits for certain users, can raise those limits.

    Even on a single user desktop machine, its nice to have limits so shitty software can't take down my entire machine. With limits I can just log in on another terminal and kill the offending program, without limits you get to reboot, and lose any work you were doing.

    1. Re:Wrong attitude. by gowen · · Score: 3, Insightful
      Reasonable limits should be in place by default,
      But given that distribution/kernel vendors do not have the first idea of
      i) My hardware
      ii) How many users I want
      iii) What programs / services will be running,

      how in the name of crikey are they supposed to determine what a "Reasonable limit" would be?
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    2. Re:Wrong attitude. by Anonymous Coward · · Score: 2, Insightful

      They aren't, you are. They are supposed to make a reasonable default, not a reasonable limit. You look at the reasonable defaults, and decide to change them on a per user basis for the different users (mysql, apache, etc). This is how unix has always been, linux distros taking huge steps backwards isn't something to be accepted.

      Lots of distros ask wether you are running a server or desktop, is it really so tough to ask if that server is dedicated to one task or many jobs, and set sane defaults based on your answer? Then say if you know you want mysql to be able to use more RAM, you can let the mysql user have a higher limit. But you don't have to worry about any of your services bringing your machine down.

    3. Re:Wrong attitude. by gowen · · Score: 2, Insightful
      What makes you think any given distro wouldn't set _reasonable_ default limits?
      Because what's "reasonable" varies from person to person, machine to machine and usage patterns.
      How many processes do you really need?
      I've no idea. The trouble is, you've no idea how many processes I need, either. And neither do Bill Gates, Linus Torvalds, Bruce Perens, the Debian process-ulimit-policy-discuss mailing list, the Grinch or Eric Bakke. That makes it pretty hard to set a "sane" limit that works for everyone
      How much memory?
      All of it, and sometimes a little bit more.
      I mean, what would you rather have: a machine that's vulnerable by default to resource exhaustion, or a machine that's _not_ vulnerable by default.
      If only it were that simple. If I'm running a Linux mail-server on a 386/66 with 8MB RAM then its not going to take a lot of processes to down the box. However, if I'm running a busy web server on a Dual Xeon box, then Apache is going to want to spawn more processes than would kill my mail server...

      So, if you protect my box from resource exhaustion with a defaulty hard limit, one of two things will happen.

      i) If the limit is low, my web server won't function very well, as it won't be allowed to spawn processes.
      ii) If the limit is high, y mail server could be killed by a fork bomb before the limits get hit.

      Simply put, you're treating process limits as a panacea, when it isn't.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    4. Re:Wrong attitude. by (1+-sqrt(5))*(2**-1) · · Score: 2, Informative
      Your sensible defaults (which you're still loathe to define) haven't help[ed] our server admin.
      Just to get some numbers on the table, here are bash's default ulimits in FC3:
      $ ulimit -a
      core file size (blocks, -c) 0
      data seg size (kbytes, -d) unlimited
      file size (blocks, -f) unlimited
      pending signals (-i) 1024
      max locked memory (kbytes, -l) 32
      max memory size (kbytes, -m) unlimited
      open files (-n) 1024
      pipe size (512 bytes, -p) 8
      POSIX message queues (bytes, -q) 819200
      stack size (kbytes, -s) 10240
      cpu time (seconds, -t) unlimited
      max user processes (-u) 8185
      virtual memory (kbytes, -v) unlimited
      file locks (-x) unlimited

      I've only had to tweak them in specialized circumstances: like running Apache-spawned processes, for instance; they weren't enough, on the other hand, to protect me against the fork bomb posted above.

    5. Re:Wrong attitude. by LurkerXXX · · Score: 2, Informative

      There are lots and lots of us *BSD folks out there, and I haven't run into any who were terribly inconvenienced by the default process limits. For most, the defaults are fine. If you do happen to need more, you probably know enough to change the default.

    6. Re:Wrong attitude. by harrkev · · Score: 2, Insightful
      The trouble is, you've no idea how many processes I need, either. And neither do Bill Gates, Linus Torvalds, Bruce Perens, the Debian process-ulimit-policy-discuss mailing list, the Grinch or Eric Bakke. That makes it pretty hard to set a "sane" limit that works for everyone
      First of all, let's separate the world in to two different type of people: normal users, and power users. Normal users will run a web browser, office applications, an e-mail client, etc. Power users are the ones who always need more resources.

      Limits should be set substantially higher than what a normal user will ever need. A normal user should never even bump into the limits.

      Now, if you ARE a power user, then you should know how to change those limits. This gives you the best of all possible worlds. You get protection, but you can CHANGE THE DEFAULTS if you need to! Simple. If you are setting up apache, you should know enough about it to set reasonable limits.

      Let me put it another way. What would you think if I said "ZoneAlarm doesn't know what ports I need open. It should open up ALL ports by default. I will shut down the ones that I don't need." That would be a pretty useless firewall.
      --
      "-1 Troll" is the apparently the same as "-1 I disagree with you."
  18. Running bash then :p by cheezemonkhai · · Score: 4, Informative

    You were running bash then :p

    I recognise that one... which is always good :)
    just don't leave your box unlocked and have some "funny" person drop it in your .login or .bash_rc files.

  19. My God, the hypocracy! by drsmack1 · · Score: 5, Insightful

    Looks like everyone out there on slashdot think this is not really a problem. Remember when it was discovered that you could get into a xp installation locally with a win 2000 boot cd? Oh, the howling that was heard.

    Here is a issue that can be done remotely with only a user account.

    1. Re:My God, the hypocracy! by shish · · Score: 2, Insightful
      Here is a issue that can be done remotely with only a user account.

      This is a fork bomb (a DoS technique), not 100% access. With this, all your secret files remain safe.

      --
      I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    2. Re:My God, the hypocracy! by slavemowgli · · Score: 2, Insightful

      Anything that requires you to have a valid user account on the machine you want to attack is, by definition, not remote.

      --
      quidquid latine dictum sit altum videtur.
  20. Reminds me of DoS: Pingfork! by nullset · · Score: 4, Interesting

    I came up with the idea of a ping/fork DoS attack (mostly as a joke)

    In pseudocode:
    while (true) {
    ping(target)
    fork()
    }

    I seriously thought of posting this to a few script kiddie sites, so the kiddies could crash themselves long before the pinging does any damage :)

    --buddy

    1. Re:Reminds me of DoS: Pingfork! by caluml · · Score: 5, Funny
      I seriously thought of posting this to a few script kiddie sites

      ...and now you have :)

  21. Are you on drugs? by Anonymous Coward · · Score: 2, Insightful

    Why is the word on in quotes? Yes, ftpd is part of the system. No, it is not running. No, it is not ready for exploit since as mentioned, its not running, and also, what vulnerabilities does it have? That likes saying openbsd is bad because it ships with popa3d. Its right there waiting to be exploited, if you are root, and start it up, and someone finds an exploit for it.

  22. another way to bring a system to it's knees by XO · · Score: 2, Informative
    while(1) { malloc(1); }
    --
    "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    1. Re:another way to bring a system to it's knees by tlhIngan · · Score: 5, Informative

      while(1) { malloc(1); }

      That won't work on modern systems, or systems with a lot of virtual memory available (lots of RAM or large swap).

      A modern OS will not actually commit memory until it is actually used, and while malloc() involves some bookkeeping, most of the bookkeeping is very little. It's quite likely you'll actually run out of process RAM (2GB or 3GB, depending on settings on a 32 bit machine) space first before the system starts to strain. On Linux, the recent kernels will kill processes that start hogging RAM when free memory falls below the low-water mark. And each malloc() really allocates 8/16/32 bytes of RAM for even a 1 byte allocation.

  23. Isn't it friggin' ironic by aendeuryu · · Score: 5, Insightful

    It's funny, isn't it, that on the same day we have a story about Linux distros being insecure by default, EXCEPT Debian, we have another story where Debian is being criticized for not releasing updates more often.

    Maybe, and here's a thought, just maybe, it's wise to take a decent, stable distro and perfect it, instead of taking a distro and submerging it in a state of perpetual flux with constant updates.

    Just a thought. I might be biased because it's a Debian-based distro that finally put a working Linux on my laptop. But you know what? Every now and then the bias is there for a reason...

  24. Silly exploit by SmallFurryCreature · · Score: 4, Insightful
    As others have already commented this has little to do with security.

    Most linux systems are used as desktops, if you use them as a server you don't use the defaults. Now a user being able to crash his own system is nothing new. It ain't nice but as long as it is the user doing it then no problem. Now if this fork could be used to make apache explode and bring down the system THAT would be a boo boo.

    Ideally yes the system should not do things that bring it coming crashing down but this is close to blaming a car for allowing me to plow into a wall. Not sure if I want a car/computer telling me what I can and cannot do.

    As to how to set the limits on the number of forks. Maybe I got this completly wrong but could it be that this depends entirely on your hardware? Perhaps the latest IBM mainframe can handle a few more then an ancient 386? How the hell is the distro supposed to know what I got?

    Security is other people doing stuff on my computer that I don't want and or know about. Me screwing stuff up is my business.

    BSD is very solid, this is known. It is also known that BSD has been along long before linux and but has been sucking it exhaust fumes ever since it arrived. For every story about how much more secure BSD is there are a dozen stories about linux actually making a mark on the world. So good. Your BSD survived a forkbomb. But why exactly was the author running a linux desktop then if BSD is so much better?

    Another non-story on /. Is the internet going to the way of tv?

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:Silly exploit by ArbitraryConstant · · Score: 2, Insightful
      "As to how to set the limits on the number of forks. Maybe I got this completly wrong but could it be that this depends entirely on your hardware? Perhaps the latest IBM mainframe can handle a few more then an ancient 386? How the hell is the distro supposed to know what I got?"

      man 2 setrlimit
      "RLIMIT_NPROC
      The maximum number of processes that can be created for the real
      user ID of the calling process. Upon encountering this limit,
      fork() fails with the error EAGAIN."
      It's part of POSIX. It should work the same on any *nix on any hardware.

      "BSD is very solid, this is known. It is also known that BSD has been along long before linux and but has been sucking it exhaust fumes ever since it arrived. For every story about how much more secure BSD is there are a dozen stories about linux actually making a mark on the world. So good. Your BSD survived a forkbomb. But why exactly was the author running a linux desktop then if BSD is so much better?"

      You're clearly unaware of the various marks BSD has made. Essentially every OS out there today runs BSD code, including Linux and even Windows, and the BSDs continue to break new ground in ways that are frankly too numerous to go over here.

      Also, most of the "difference" Linux has made is actually software that will run on BSD as well.
      --
      I rarely criticize things I don't care about.
  25. Re:Grep Bomb (try it in freebsd) by keepper · · Score: 4, Informative

    A good vm should do enough accoutning to allow you to log back in and kill those.

    So, try this in FreeBSD, and be amazed, now try it in any 2.4 or 2.6 linux kernel, and be disgusted.

  26. No, this is completely incorrect. by Anonymous Coward · · Score: 2, Insightful

    You can limit users to using less than 100% of your resources, and those users can still do things. Its still a very usable system. I have this even on my laptop where I am the only user, so poorly written software or random mistakes don't result in me having to reboot my machine. Just the other day I messed up a pike script and it used up all my RAM. But my ulimit was set to 128MB of RAM, so pike just got an out of memory error and exited. Without ulimit it would have sucked up all my RAM and swap and I would have to reboot.

    This kind of uninformed and ignorant attitude seems quite common in the linux world now that most users aren't experiences unix admins. It would be a good idea to learn about something before claiming to know how it should be setup.

  27. Re:In other news... by MrHanky · · Score: 3, Informative

    No. I've played with fork bombs in Windows with SFU or Cygwin, and they didn't bring down the system. Seems like there was a sane ulimit on processes.

    Try ":(){ :|:& };:" (without the quotes) on your bash prompt to see if you are vulnerable.

  28. I missed the part..... by deathazre · · Score: 2, Interesting

    ... where gentoo had a default kernel

    (can we PLEASE not bring genkernel into this? it sucks.)

    --
    Karma: Negative (Mostly affected by dorm trolling)
  29. Re:Big Fuss by agraupe · · Score: 2, Interesting

    The difference being that a default install of *anything*, except possibly OpenBSD, should be in a situation where there might be users on it that you don't trust completely. For my personal use of linux, all I need is a box that is secure from hackers, not users.

  30. A headline without merit? by cabazorro · · Score: 2, Informative

    The first line of defense ..and the most critical is getting access to the system.
    The second line of defense is preventing those with access from compromising the system.
    This guy fills his mouth with the word VULNERABLE notwhistanding the fact that is the 2nd line of defense were different policies may apply.
    As far as I'm concern, when you get an account from me, I trust you. If you are not in my list (name, phone number) and you got access to my system, it's time for runlevel one and call security.

    --
    - these are not the droids you are looking for -
  31. Default kenerl in Gentoo? by olympus_coder · · Score: 5, Informative

    Unless you use genkernel, there is NO default kerenel configuration, verions or anything else. No serious admin uses genkerenel as anything other than a starting point - PERIOD.

    Choose your kernel version, patch set, etc. No defaults. I guess he has never actually installed gentoo himself. The author should get a clue about the distro's he's talking about before making clames about their security.

    --
    Spell check? Why bother. That is what grammer/spelling Nazi freaks who waiste band width posting "spell right" are for.
  32. Windows Crashes, as well. by fr1kk · · Score: 2, Interesting

    If you open up Cygwin on Windows XP, and run:

    :(){:|:&};:

    it will bring your system to a halut (mine at least).

    Currently I've got a 2.8Ghz 512Mb ram, XP SP2.

    I couldnt even get into my task manager, I got about 10 virtual memory errors. Then I rebooted and tried with the task manager open. Once the VM graph shot striaght up past 1GB, it stopped refreshing (4 seconds).

    --
    sig: Playfully doing something difficult, whether useful or not
  33. Re:In other news... by caluml · · Score: 2, Interesting
    Try a WinExec bomb instead. You can bring down the system in 2-3 minutes.

    Is there a ulimit equivalent for Win32?

    Just as an after thought, why don't people run public Windows servers and allow people to login, like Unix shell servers?

  34. I felt dumber for reading that article. by cybrthng · · Score: 2, Insightful

    What exactly was that point? I can "forkbomb" my car by filling it up with too much crap, i can "forkbomb" my airplane by exceeding it's design limitations.

    I guess my point is certain limits are by design and its up to operator training and guidance on how to work with those limits to make sure they don't exceed them.

  35. Re:In other news... by Vihai · · Score: 2, Insightful

    The TCP/IP stack, recently vulnerable again to the LAND attack is not part of the kernel?

  36. He has missed the point... by olympus_coder · · Score: 3, Insightful

    Security is a balance between making a computer immune to attacks and providing capabilities.

    I run a several labs at a university. I don't even bother to lock the linux side of the machines down much past base install. My users have never tried to cause problems. I don't even use quota.

    If someone ever does cause a problem, I'll take the lab down (cause a pretty good backlash from their fellow grad students) and fix it.

    In the mean time, I like the fact that when someone ask me "how much of X can I use" I say, as much as you need so long as it doesn't cause a problem. I'm never going to get mad if they run a large job, etc that slows the machine down. I can always kill it, and ask them to run it on one of the dedicated computers.

    Point is, why limit something that is only an issue if you are working against your users, instead of for them? In 99% of the installs that is the way it is (or should be).

    --
    Spell check? Why bother. That is what grammer/spelling Nazi freaks who waiste band width posting "spell right" are for.
  37. I remember forkbombing myself by gosand · · Score: 4, Interesting
    I was working at my first job, and we had 10 people to a Sun server. I was writing shell scripts, and wrote one called fubar that was this:

    while [1] do
    fubar &
    done

    Then I did chmod +x fubar, and typed "fubar &"

    oops.
    The system load started climbing and everyone else on the machine started bitching. I thought it would crash, and went over to the local admin and fessed up. Of course, we were all interested in what would happen. Nobody could get in to kill it, and the processes were spawning so fast that we couldn't catch it. It was taking forever just to log int. But the load leveled off, and it wasn't going to crash. The admin was going to reboot it, but then I said "wait a second!" I went back to my window that was open. Know what I typed?

    rm -f fubar

    I suppose you could make it more nasty by making the file name create a copy of itself and name it the process id, so that you wouldn't be able to rename it.

    cp $0 .$$
    ./.$$ &

    This will leave all the process files laying around, but you could code something to remove them. But this gets the point across.

    --

    My beliefs do not require that you agree with them.

  38. Re:Grep Bomb (try it in freebsd) by ArbitraryConstant · · Score: 2, Interesting

    "???@mylinuxbox ~ $ grep foo /dev/zero
    grep: /dev/zero: Cannot allocate memory
    "

    I don't think they're killed automatically. They seem to be running out of memory.

    Of course, the same thing on my OpenBSD box doesn't run out of memory... Either a the GNU grep has a memory leak or the BSD grep has a check for something (long lines?).

    --
    I rarely criticize things I don't care about.
  39. Not worth the risk. by Mr.+Underbridge · · Score: 4, Insightful
    Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug. Inability to turn that feature off would be a bug, but given that few modern Linux boxes are actually used as multi-user remote-login accounts, it's a completely unecessary overhead.

    Right, it's a feature, but the question isn't whether it should ever be allowed, but what the default setting should be. I think the article made a pretty good case that default should be no.

    And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

    First, I think a lot of unix people would be shocked to find that's on by default as the writer was. Second, that basically means that anyone who successfully hacks into a user account takes the machine down. That applies for your desktop machine, not just "old-style" unix type servers. Third, you mention the relative scarcity of old style servers these days - they're still more common than a user who needs to run an INFINITE number of programs. Even capping somewhere in the thousands would work, keeping anyone from being hampered in their work.

    Basically, this is a case of idea vs. reality. You want the IDEA that you can run as many programs as you want, though you'll never need to. So in REALITY, a sane cap never hurts you. However, a lack of a cap provides very REAL security problems, either from a user or from someone who manages to hack a user account. Again, you really don't want EVERY userland exploit to lead to a kernel takedown, do you?

  40. Re:In other news... by tomhudson · · Score: 5, Informative
    The Windows holes aren't in the FRIGGING KERNEL.
    Neither are the "holes" the article talks about.

    If you had bothered to read the thread the article points to, the forkbomb vulnerability wasn't in the kernel per se, but in the /etc/security/limits file, which on most distros has a bunch of example lines commented out by default.

    The kernel can't/shouldn't implement limits that are commented out.
    Edit the file(s) to your taste and reboot.
    No kernel patching necessary.

  41. Re:So- by slavemowgli · · Score: 2, Informative

    If you're administering a server with multiple users that are potentially malicious (or at least pranksters), then this is a real issue. If you use Linux on your desktop, then it's mostly theoretical - at worst, it could be an extra puzzle piece that allows another exploit to have a bigger effect.

    --
    quidquid latine dictum sit altum videtur.
  42. Re:In other news... by Flying+Purple+Wombat · · Score: 4, Informative

    On my Win2k box, running ":(){ :|:& };:" at a Cygwin bash prompt DOES kill the system. I don't know enough about Windows admin (and I don't care enough to learn) what would prevent a forkbomb.

    --
    If God had meant for man to see the sunrise, He would have scheduled it later in the day.
  43. Re:Welcome to Linux by DemENtoR · · Score: 2, Insightful

    You'll get OMM killed faster, than you can read the line "welcome to linux".

  44. Debian Sarge is vunerable by peterpi · · Score: 3, Informative
    I just locked myself out of my Debian sarge machine with the following:

    (forkbomb.sh)

    #!/bin/bash
    while true; do
    ./forkbomb.sh
    done

  45. Re:How long? by Kong+the+Medium · · Score: 2, Funny

    And the answer is:

    5 minutes.

    --
    ... whenever a text is transmitted, variation occurs. This is because human beings are careless, fallible, and occasiona
  46. Re:Thread, not process! by Todd+Knarr · · Score: 2, Informative

    No, on Unix fork() creates a new process that, usually temporarily, shares a (usually copy-on-write) memory space, file descriptors and other things with it's parent. Threads are created via the pthread_create() call (or thr_create() on Solaris).

    Now underneath, some popular OSes implement threads as full processes which happen to share a page table and system resources with their parent process, but you still don't create them with fork().

  47. We're talking DEFAULTS by Stephen+Samuel · · Score: 4, Insightful
    Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug.

    Just how many regular users expect to run 20000 processes at once? (or even 200?) When that happens it's almost always caused by a bug (or malicious activity). Right now, I have 50 user processes running. I'm a power user, but I'd probably never get blocked by a limit of 1000 unless I was doing something really wierd -- and something that weird should come with instructions on modifying the kernel settings.

    Yes, it should always remain possible to set up your system so that you can run massive numbers of processes and/or threads, but the default should be to keep numbers to a dull roar in favour of system stability. People whose needs are such that they actually and legitimately want to fork massive numbers of processes are also the kinds of people who wouldn't have a hard time figuring out how to change the kernel settings to allow it.

    As such, the default should err on the side of security, but allow a knowledgable user to do whatever the heck he wants.

    Thing is, though, that local resource-exhaustion exploits are difficult to set. You want to allow a user felatively free reign -- even to the point of stressing the system, but still allow enough of a reserve so that an admin cam login and shut down a user who'se gone overboard. You also want to set a limit that will be reasonable 5 years down the road when processors are 10 times as fast (and/or 20-way SMP is standard issue)

    Something to note here in Linux's favour: Even though the forkbomb brought the system to it's knees it stayed up. Although it might have taken 1/2hour to do, an admin may have been actually able to login and kill the offending process.

    --
    Free Software: Like love, it grows best when given away.
  48. Re:In other news... by theMidniteMinstrel · · Score: 2, Insightful

    The moral of the story is that any system is only as good as the system administrator makes it. If you realize that you've got this problem on a mission-critical system, or even a web-server that sees heavy traffic, that administrator deserves to be fired. Come on, people, let's get over this "out of the box security" metric. It's worthless.

  49. YOU may not run them... by Paradox · · Score: 3, Insightful
    If you follow the link in the article to the original entry from security focus, you'd see that malicuous remote user comprimised a machine that was patched up to current.

    Seriously, if you're letting people log onto your PC and run fork bombs, you have far greater problems than a lack of resource limits in the default install.


    Look, you seriously misunderstand something here. Run a server long enough and it gets very likely that even with the latest patches, you will get attacked. If someone breaks into your box, exactly how much power do you want them to have?

    The ability to bring the machine to a screeching halt with an attack that dates back to the Land Before Time is not a feature! It is a security hole and it's every bit as important to fix as your exterally visible holes.

    Because, one of these days some cracker is going to get the drop on your box. You'd better hope your box is ready for that.
    --
    Slashdot. It's Not For Common Sense
  50. No, you are treating it as a panacea. by Anonymous Coward · · Score: 5, Insightful

    We aren't saying that default limits will be perfect for everyone. We are saying that its better to have to raise your limits IF YOU NEED TO, then to have your machine vulnerable to being completely taken down trivially, very possibly by remote users with no accounts, just from making your services work harder than you expected.

    If you are running a server than needs hundreds of apache processes running, then you know that and can raise it. Someone who is new to linux won't need that, and won't know how to setup limits for themselves. So you make the machine secure by default, and allowed advanced users with advanced needs to tweak things as they need.

    The best thing I can think of to illustrate the point to you is your apache example. By default apache won't let you have more than 150 users connected. This is a sane default to protect from resource exhaustion. If you need more than that, you can set it yourself. People have some protection by default, but advanced users can customize the settings for their needs.

    I cannot believe in 2005 I am arguing with someone who thinks secure by default is a bad idea because it might invonvenience you.

    1. Re:No, you are treating it as a panacea. by gowen · · Score: 2, Insightful
      then to have your machine vulnerable to being completely taken down trivially,
      There is nothing trivial about obtaining a user account on my machine. If someone you don't trust can run a forkbomb on your machine, you've already been Pwned, and it's too late to apply a band aid.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  51. Linux ignored a lot of rlimits until recently? by wsanders · · Score: 4, Interesting

    In the past I've been awakened in the dead of night by my IDS'es detecting a fork bomb and it's always been self inflicted - some dumbass^H^H^H^H^H^H^Hmisinformed programmer not understanding why it's important to check the return status of a fork() or set alarms to kill off hung sockets.

    I found some earlier kernels ignored RLIMIT_CPU, RLIMIT_RSS, and RLIMIT_NPROC, and setting the CPU and RSS limits in Apache was ineffective. This was in the Red Hat 9 / 2.4.20 kernel days. I have not researched this in a year or so. If all this stuff works now, let me know so I can insert a "ulimit -Hu 10" in future startup scripts as a "courtesy" to inattentive programmers.

    --
    Give a man a fish and you have fed him for today. Teach a man to fish, and he'll say "WHERE'S MY FISH, YOU IDIOT?"
  52. -5 Advocacy by ajs · · Score: 2, Insightful

    Honestly, when will Slashdot stop posting trolls as stories. This is a clear case of "BSD is better than Linux because feature X has a DEFAULT that BSD people think is wrong". There's no security implication in the sense that most people would think of it (no remote root exploit, no remote exploit, no remote priv escalation, no remote DoS, no local root exploit, and no local priv escalation... just a local DoS... if that's what you were looking for, I can show you some OpenGL code you can throw at the display that will render your bus unusable on any display-acceleration capable graphics card regardless of OS).

    Please, just stop posting this cruft as "news for nerds,"; it's not news and any self-respecting nerd knows bad advocacy when he/she sees it. I like BSD. I was a major BSD guy back in the day, from BSD 4.2 to Ultrix up to SunOS 4.x. BSD is great.

    Linux is also quite nice.

    They both have a ton of great features and a ton of other annoying features / arguably bugs. Linux has more features and more bugs because more people contribute to it, but that's both a blessing and a curse for the BSDs.

    Once agian, carry on. Nothing to see here.

  53. Speaking of insecure.... by JohnTheFisherman · · Score: 4, Funny

    Many Linux users found to be insecure whenever the faults in their OS are pointed out. ;)

  54. Problem with defaults, not kernel by CustomDesigned · · Score: 2, Insightful
    $ grep foo /dev/zero
    grep: memory exhausted
    $ ulimit -a
    time(cpu-seconds) unlimited
    file(blocks) unlimited
    coredump(blocks) 0
    data(kbytes) unlimited
    stack(kbytes) 8192
    lockedmem(kbytes) unlimited
    memory(kbytes) 81920
    nofiles(descriptors) 1024
    processes 3071
    The default for memory is unlimited, which does indeed create a DOS "attack" for "grep bomb" and other inadvertant application bugs.

    This is a case of bad defaults, not a kernel problem. I recommend a max physical memory of no more than 1/4 physical memory, preferrably less.

    AIX also has cruddy defaults, but ulimit -m limits physical RAM, not virtual RAM. That way, a single process with run-away memory use will just start swapping like crazy and let the rest of the system keep running. Of course, even then a dozen or so such processes will still bring the system to a crawl. I would like to see physical RAM limited by user id.

  55. ahh... by Anonymous Coward · · Score: 2, Funny

    open source development

  56. Re:Forget security, what about innocent mistakes? by ssj_195 · · Score: 2, Funny
    Nevertheless, that doesn't stop a misbehaving program from accidentally fork-bombing the system
    I fork-bombed myself by using the Folding At Home gkrellm plug-in, once. It has an option to restart the F@H client whenever it stops, which I selected. Unfortunately, the code for detecting whether or not a F@H process was already running appeared to be faulty, and 1 minute later I had to reach for the reset switch.

    It's a shame I don't have a couple of hundred processors in my desktop PC, else I would have folded the fuck out of some proteins :)

  57. quick perl fork by dougnaka · · Score: 3, Informative
    this one liner was my bane in ctf at defcon 10..

    perl -e 'while(1){fork();}'

    Course we were running VMware, initially with their very insecure RedHat 5.2 I think it was..

    Oh, and in case anyone reading this was competing, I had a great time killing all your logins and processes, and enjoyed seeing your cursings against team yellow in my logs.. but the perl thing, along with a very small team, took us out completely..

    --
    My Linux Command of the Day site : LCOD
  58. Re:Run this: by Foolhardy · · Score: 2, Interesting
    Hmmm, here on my Windows box:
    jobprc -prclimit 50 c:\cygwin\bin\bash
    bash-2.05b$ :(){ :|:&};:
    bash: fork: Permission denied
    ... (about 100)
    bash: fork: Permission denied
    3 seconds later, and it's over with the last two bashes stalled, waiting for ctrl-c. The same thing happens under SFU, but it displays less Permission denied messages. The rest of the machine didn't even notice.

    That's what job limits are for. Shameless plug: get jobprc, a GPL'd command-line job creator (written by me) here.
  59. Oh, but wait.... by Marthisdil · · Score: 2, Insightful

    The Linux fanatics are trying to say that Linux is ready for the desktop and home use....Yeah, like some home user is gonna be able to squash security issues like these on their own.

    EXACTLY why it'll be a very long time before users will be comfortable.

    But wait....Linux is more secure than Windows....riiiiiiight..../sarcasm off

  60. vulnerable because of ssh, not like cmd by planckscale · · Score: 2, Funny
    YEah because you can ssh like into almost any linux box. Not so in windows. That's why I use windows. In windows, you open up a command prompt, and then if you type in the command:

    c:\>cmd 192.168.0.101

    it brings you right back to the command prompt:

    Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.

    That's security right there. You can't even get a command prompt from another box within command.

    --
    Namaste
    1. Re:vulnerable because of ssh, not like cmd by agraupe · · Score: 2, Interesting

      I know you meant this as a joke, but it brings up an interesting question: why is SSH enabled by default on most linux distros? As Linux moves toward higher desktop use, does it really make sense to have remote access enabled by default? Surely if you need or use this functionality (as I do), you can determine how to activate it yourself, no?

    2. Re:vulnerable because of ssh, not like cmd by planckscale · · Score: 2, Interesting
      I'm not 100% sure but I believe a Knoppix Live CD and a newly installed Knoppix hard drive install has this disabled by default. To which distro's in particular are you referring?

      --
      Namaste
  61. MOD PARENT DOWN by Anonymous Coward · · Score: 2, Informative

    He doesn't know what the fuck he's talking about. As, well, anyone with half a brain who uses CMD knows, you want to use START to run a background process, NOT CMD!

    START KILL.BAT
    KILL.BAT

    Try that on a Windows XP system you could care less about. You'll have to reboot it to get back in.

  62. Lotsa Everything! by x2A · · Score: 2, Informative

    I like:

    :loop
    for %a in (\windows\*.exe \windows\system32\*.exe) do start %a
    goto loop
    hehe

    --
    The revolution will not be televised... but it will have a page on Wikipedia
  63. OMG, rm -rf / still works as root too!! by fatboy · · Score: 2, Funny

    OMG, rm -rf / still works as root too!!

    Why is Linux still vulnerable by default?

    --
    --fatboy
  64. bombing a linux box by amiliv · · Score: 2, Informative

    There's more ways to kill Linux box from user space. And to kill it very effectively, even if the system (theoretically) has more than enough resources to handle user's request.

    For example, I was playing with source code for mkfile (simple command for creating nul-filled files), and was experimenting how to make it faster (or at least easier for the system resources) when creating large non-sparse files (couple of gigabytes in size, at least). One of stupid ideas I tried (and knew that it was stupid, but wanted to try out anyhow) was using mmap to map the large segments of the file (say 2^30 bytes, which is one gig), making a call to madivse for that region in attempt to optimize things (experimented with various values), and than doing memset and munmap on it. Run it to create 10 gig file. Guess what. Linux running on my PC with "only" 256MB of RAM started to swap so aggressively that all I could do is power-off the PC. I couldn't swith out of X to text console. SSH session from another machine was totaly dead. The machine was totaly dead, completely frozen. Except the disk light that was on. Single process that needs to swap a lot. And machine is *totally* dead.

    Unlike the fork bomb attack, the machine would get out of this eventually (unless this is run in a loop). Probably in couple of hours. Or by the next day. I hadn't that much time on my hands, so I powered it off, and on again. Back to the drawing table.

    I knew that what I coded wasn't smart, but to trash machine like that....

    Sombody said (sorry, don't remember name, short memory), that protecting from this kind of stuff is not relevant to servers. I don't agree. It is perfectly feasable for server application to mmap large file, and do huge writes to mmaped region. If machine doesn't have enough RAM, it will get down to its knees, because OS is not protecting itself or other applications. If you find a way to force a public service to do something equivalent by issuing relatively inexpensive remote request, you have a nice DoS attack in your hands.

    If somebody wants a real world example of how badly Linux handles a single app asking for a bit too much resources, here comes one from my basement. There's one old machine I use as web server, proxy server and cyrus imapd. It is an old machine, Pentium MMX, 96 megs RAM. For two user accounts, it works perfectly, and more than fast enough. Run "yum update", and things simply fall apart. It becomes completely unresponsive. Reason? Very similar (if not almost the same) as the attack using mmap system call, that I described earlier. Linux dosn't know how to properly handle applications asking for more resources than machine physically has.

  65. Install media + physical access + clue = ownership by dbIII · · Score: 2, Insightful
    I do not trust everyone with access to a win2000 boot CD.
    You can even get into a headless solaris box with an install CD and a serial terminal. You can then blank the root password and boot the system normally - you then have full access. Any machine that people have full physical access to is vunerable to those people - the most locked down box is still vunerable to someone pulling out the drive with its root partition, mounting it, and editing password files.

    Technology is no substitute for physical security, as Kevin Kline's character in "Fish Called Wanda" showed by getting a gun past a metal detector in the common airport security situation of watching the luggage and not the person.

    If you can boot a machine with your own media or pull it apart and no-one notices, then you can have full control - whether it is win2k or whatever.

    As for network security, virtual machines with quotas have to be the way to go so long as there are loonies with root passwords that enable telnet, install a compiler and use "coffee" as a password.