* memory/cpu handling problem ? (x86)
@ 2001-12-05 22:39 Nico Schottelius
2001-12-05 23:23 ` Doug McNaught
[not found] ` <u8elm99qsn.fsf@gromit.moeb>
0 siblings, 2 replies; 4+ messages in thread
From: Nico Schottelius @ 2001-12-05 22:39 UTC (permalink / raw)
To: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
Hello Folks!
A small ansi C program which tries to get all cpu power and as much ram
as possible got my system.
Background:
Discussing about NT and Linux with friends I decided to write a program
to demonstrate how the os reacts if one process tries to get the whole
system.
Please take a look into the attached program, before you continue
reading.
1, NT Test
System keeps on beeing stable, no new programs can be started.
2. Linux Test (1 process)
System hangs. No keyboard nor network conection is possible.
SysRq-Kill kills the process.
3. Linux Test (3 processes)
Nothing to do anymore. System is blocked. SysRq still reports
what it does, but not even killall/SAK helps. s+u+b was the only
possible solution.
The program ran under a standard user id on both operating systems.
I was not able to ctrl+c/z the process under Linux.
Question: Isn't that some kind of security or at least DoS hole ?
Could not anybody with SSH / Telnet access to a server stop this
server running ?
Is it possible (via sysctl ?) to impede that ?
Please CC me when answering.
--
{Greetings,Gruss},
Nico Schottelius
I am some kind of busy -
Do not expect an answer within 24 hours.
Instead use the telephon: +49 (0) 173 - 750 7022.
[-- Attachment #2: ram_voll2.c --]
[-- Type: text/plain, Size: 1408 bytes --]
/*******************************************************************************
* Test what the OS does, if there is no ram and cpu left.
* Author: Nico Schottelius <nicos@pcsystems.de>
* Date: 4th of July 2001
*
*
* 5th of Decembre 2001:
* added initialization of the new allocated ram. Without this 'feature'
* Linux 2.4 has no problems. It is even possible to allocate 2000 MB RAM,
* where only 128 MB is! (Linux gives you 'SoftRam'...)
*
******************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#define lint long int
lint add(lint last) {
if(last == 0)
return last;
else if(last < 0)
return -1;
else
return last + add(last -1);
}
int main ( void )
{
char **uebervoll = NULL;
int x = 1, a = 0; /* how many megs to allocate within one step */
int one_k = 1024;
int one_meg = one_k * 1024;
lint i = 0;
uebervoll = (char **) realloc(uebervoll, (i+1) * sizeof(char *) );
for(i=0;;) {
uebervoll = (char **) realloc(uebervoll, (i+1) * sizeof(char *));
if(uebervoll != NULL) {
uebervoll[i] = (char *) malloc(x * one_meg * sizeof(char) );
/* init allocated ram */
for(a=0;a<(x*one_meg*sizeof(char));a++) uebervoll[i][a] = 'a';
if(uebervoll[i] != NULL) {
i++;
printf("%d MB RAM allocated\n",x * i);
}
}
}
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: memory/cpu handling problem ? (x86)
2001-12-05 22:39 memory/cpu handling problem ? (x86) Nico Schottelius
@ 2001-12-05 23:23 ` Doug McNaught
2002-03-14 9:01 ` Nico Schottelius
[not found] ` <u8elm99qsn.fsf@gromit.moeb>
1 sibling, 1 reply; 4+ messages in thread
From: Doug McNaught @ 2001-12-05 23:23 UTC (permalink / raw)
To: Nico Schottelius; +Cc: Linux Kernel Mailing List
Nico Schottelius <nicos@pcsystems.de> writes:
> Hello Folks!
>
> A small ansi C program which tries to get all cpu power and as much ram
> as possible got my system.
$ man setrlimit
-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: memory/cpu handling problem ? (x86)
[not found] ` <u8elm99qsn.fsf@gromit.moeb>
@ 2001-12-06 19:52 ` Nico Schottelius
0 siblings, 0 replies; 4+ messages in thread
From: Nico Schottelius @ 2001-12-06 19:52 UTC (permalink / raw)
To: Andreas Jaeger, Linux Kernel Mailing List
> NIco,
>
> can you describe your system a bit - hardware and especially LInux
> Kernel version? Please answer to the list,
No problem at all:
cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 5
model name : Pentium II (Deschutes)
stepping : 3
cpu MHz : 399.323
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca
cmov pat pse36 mmx fxsr
bogomips : 796.26
mainboard: ??? (must be some asus or gigabyte...I think it was a
gigabyte,
the one with the adaptec 7880 scsi controller on board.
RAM: 128 + 256 MB
Kernel 2.4.13
Does this help or do you need more informations ?
Sincerly,
Nico Schottelius
I am some kind of busy -
Do not expect an answer within 24 hours.
Instead use the telephon: +49 (0) 173 - 750 7022.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: memory/cpu handling problem ? (x86)
2001-12-05 23:23 ` Doug McNaught
@ 2002-03-14 9:01 ` Nico Schottelius
0 siblings, 0 replies; 4+ messages in thread
From: Nico Schottelius @ 2002-03-14 9:01 UTC (permalink / raw)
To: Doug McNaught; +Cc: Linux Kernel Mailing List
Doug McNaught wrote:
> Nico Schottelius <nicos@pcsystems.de> writes:
>
> > Hello Folks!
> >
> > A small ansi C program which tries to get all cpu power and as much ram
> > as possible got my system.
>
> $ man setrlimit
thanks for the answer!
I just thought linux could handle itself a process which tries to gain all
cpu power.
Using setrlimit I can setup maximum cpu time seconds, but not maximum use of
cpu
at a time, can't I ?
--
Nico Schottelius
Sorry for delayed messages. The backlog is getting smaller!
It's less then 50 mails currently!
Please send your messages pgp-signed or pgp-encrypted.
If you don't know what pgp is visit www.gnupg.org.
(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-03-14 17:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-05 22:39 memory/cpu handling problem ? (x86) Nico Schottelius
2001-12-05 23:23 ` Doug McNaught
2002-03-14 9:01 ` Nico Schottelius
[not found] ` <u8elm99qsn.fsf@gromit.moeb>
2001-12-06 19:52 ` Nico Schottelius
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox