death by swapping (was Re: Limits in the kernel)

Trevor Johnson (trevor@jpj.net)
Sun, 21 Jun 1998 22:37:12 -0400 (EDT)


> Is it possible to configure the kernel in the same manner as a
> solaris/sunos kernel (/etc/system)? It is very easy for a regular user to
> make a linux box unresponsive and crash eventually.
>
> This simple program will do that:
>
> main ()
> {
> fork();
> main();
> }

It's not supposed to make Linux crash, even from an account where you
didn't bother to set resource limits. However, can bring Linux 2.1.106 to
an unusable condition for me--a condition which it also triggered when I
run ordinary programs. I am able to change consoles and use the magic
SysRq and Scroll Lock combinations. I can type my name into a getty and
it's echoed back, but I get no other response from it or from other
programs. The last time I experienced this, I was running three instances
of tcsh and one each of telnet, ssh, lynx, and pine. I wasn't running any
fork bombs. I used Alt-Scroll Lock and wrote down some of the EIPs:
c011bbde and c0120138 appeared repeatedly. I also saw c011bbd8, c011bbfe,
c011bc01, c011bc13, c01200a4, c012020d, c012020d, c01204bf and c0121991.
In System.map, I found:

c011bb8c T shrink_mmap
c011bdf4 T page_unuse
c011beb0 T update_vm_cache
c011bfb0 t try_to_read_ahead

c011ffc0 t swap_out_vma
c01203e0 t swap_out_process

c0121824 T get_swap_page
c0121994 T swap_free

Obviously the kernel is spending its time trying to swap. I say "trying"
because I don't have any swap enabled, only 64 MB of physical RAM. When
it gets into this condition, I can only shut down using the magic SysRq.

I reported this earlier, under the subject "2.1.105 programs freeze,
kernel continues to respond" and no one had any remarks about it.

> I'm sure you all know that, now the question is, how do I prevent
> something like that from happening, and is it possible to set some sort of
> limits in the kernel?

Begin3
Title: LShell
Version: 1
Entered-date: 3/8/95
Description: Stub that executes login shell after setting resource
limits
based on entries in a configuration file. Makes it easy to
set, enforce, and maintain limits on number of file
descriptors, cpu time, virual memory consumption, and
number
of processes.
Keywords: Utility Security Quota
Author: Joel Katz <Stimpson@Panix.COM>
Maintained-by: Joel Katz <Stimpson@Panix.COM>
Primary-site: ftp.epinet.com://pub/linux/sources/bin/lshell-1.tar.gz
Alternate-site: sunsite.unc.edu://pub/Linux/Incoming/lshell-1.tar.gz
hopefully soon to be somewhere appropriate
Original-site: ftp.epinet.com
Platform: Linux, versions 1.0 and up
Copying-policy: Copyrighted but freely distributable
End
___
Trevor Johnson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu