Linux destroyer
enric

Hi,
I am learning about linux-programming and wrote this prog:

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

I thought it would be fun. At first it was: I ran it as a normal user, tryed to start a program, and it said "out of pids", then somehow the gterm which ran it crashed, and I wasn't able to do a killall or a shutdown or a "su" because I was out of pids :P Basically I did a ctrl-alt-del and it didn't work either so I had to reset:

:P :P !
The ext3 system partition was broken and unreparable => Reinstall. Luckyly I have a separate partition for /home so I am up and running now (didn't loose data).

So my question: a simple user can render a computer unusable? with such a simple prog? Why is so. Shouldn't users have a limited number of pids?

I admit I was a bit disappointed by this "security hole"

SUSE 9.0 btw.

BAF

you can use PAM or even just simple security file (someplace in /etc) to limit the amount of pids one user can run. Most production servers do this.

Rash

Have you tried ReiserFS or XFS as file system instead?

And this doesn't belong in this forum.

ReyBrujo

Indeed.

BAF

XFS sucks, that is even less tolerant to abrupt shutdowns.

ReyBrujo
Quote:

The ext3 system partition was broken and unreparable

Sure? I remember when I once ran a recursive program that created directories inside directories and the hard disk went mad. I had to reboot, enter as single user (the system forced me into single user mode, rather), and run fcdsk (I think, Redhat 7). That fixed all the lost inodes and after rebooting I could delete the bunch of directories and continue working.

Evert
Quote:

and I wasn't able to do a killall or a shutdown or a "su" because I was out of pids

Switch to a different vterm, login as root and kill the user processes?
At least I'd hope the system keeps some PIDs reserved for root...

Chris Katko
Quote:

I thought it would be fun. At first it was: I ran it as a normal user, tryed to start a program, and it said "out of pids", then somehow the gterm which ran it crashed, and I wasn't able to do a killall or a shutdown or a "su" because I was out of pids :P Basically I did a ctrl-alt-del and it didn't work
either so I had to reset:

How'd a user-level program destroy the computer? What happened to this "linux security" thing?

Quote:

The ext3 system partition was broken and unreparable => Reinstall. Luckyly I have a separate partition for /home so I am up and running now (didn't loose data).

o_O

How did a program destroy your partition? It shouldn't be able to harm it.

BAF

ctrl+alt+del killed it. It can happen any place. It is journaled, a bad jorunal or corruption caused by an abrupt shutdown, or shutdown with data still in the HD cache can cause that stuff.

Chris Katko

But... wasn't that the point of having a journalling (sp?) file system? I guess it's no NTFS, eh? ;)

Billybob

enric: I agree it's odd that there is no default PID limits. As said you can put one in, and you should. It's listed in the Gentoo security guide, BTW. Which is a semi-good read even if you don't use Gentoo.
Why there is no default limit is beyond me though. What normal user would be running over, say, 1000 processes?

Thomas Fjellstrom

Odd, I've had some nasty crashes in linux, and not once was it not able to boot (since I started using ext3). And untill just recently it was set to not run a check on startup (stupid mistake, it caused some odd errors, as if you dont run the check, the journal isn't applied.)

HoHo

I've user ReiserFS and had some crashes(couple tests with a bit too unstable machine and some driver problems) but I've never destroyed or harmed the file system.

Avenger
razor

Is ext3 that unstable? I've killed mine using the power switch a number of times without a problem (of course it has to run it's nice check at the beginning). This is both on gentoo and mandrake.

Evert

Ext3 should be fine, normally. I've had some severe crashes and never had a problem with the filesystem. Then again, I barely have ever had problems with FAT in DOS and Windows either.

Crazy Photon

Sometimes I experienced lost files on ext3 when my system crashed, actually I once lost some init script, so I had to reinstall... With ReiserFS things were much better in that sense, altough performance goes down... I am trying XFS now to see how it is, altough I had no crashes yet...

razor
Quote:

Ext3 should be fine, normally. I've had some severe crashes and never had a problem with the filesystem. Then again, I barely have ever had problems with FAT in DOS and Windows either.

The only problem I've ever had with windows (NTFS) was when my ram went bad and some seriously screwed files were copied back to the drive from ram. Then scandisk tried to fix everything and froze. Needless to say everthing was screwed from there.

Arthur Kalliokoski

I've been running linux on ext2 through reiserfs since '97 and never had the filesystem mess up (although that's partly because it never crashes unless I do something truly stupid like a fork bomb "just to see what happens". OTOH, Windows messes up so often (dual boot) that I have the procedure to save & restore windows partitions to a linux dir down cold.

BSOD as per usual, hardware reset necessary
On booting windows "To avoid seeing this error always shut down from start menu" implies it's MY fault, stick more pins in the bill troll.
windows scandisk turns everything into a CHK file
reboot, tell grub to boot linux.
dd bs=512 count=20000 if=/dev/zero of=/dev/hda1 (then hda2 if D: munged)
run the windows install cd
use linux install disk rescue option to dd bs=512 count=1 if=grubimage of=/dev/hda to repair windows rewrite of MBR.
cd /winbak2384/C
cp -r --preserve=timestamps allegro /windows/C
rinse lather repeat...

Archon
Quote:

implies it's MY fault, stick more pins in the bill troll.

Troll? If you said doll, it'd make more sense... How many people have a voodoo dool of Bill Gates and stabs the doll when Windows messes up?

Arthur Kalliokoski

to me, "doll" implies something attractive... (Hey doll!)

BAF

you are using win98? eeeew :P

Arthur Kalliokoski

I like real live DOS! I still have a "I (heart) DOS" bumper sticker which nobody understands anymore.:D

Archon
Quote:

"I (heart) DOS" bumper sticker which nobody understands anymore.:D

Isn't the acronym for DOS being converted to the common term for Denial of Service?

jhuuskon

No, that's DoS. ;)

Thread #485295. Printed from Allegro.cc