Subject: Re: Segmentation fault disaster
To: None <current-users@NetBSD.ORG>
From: David Jones <dej@eecg.toronto.edu>
List: current-users
Date: 04/20/1995 18:30:46
>    Could the kernel name not be retained in the kernel and made available
>    to /etc/rc?
> 
> That really doesn't solve the problem.  It just makes the behavior
> even more magic.
> 
> The only real solution to this is to always retain the kernel symbol
> table in memory (allowing it to be paged out if DDB is not present),
> and have a way of retrieving it.

The _REAL_ solution is to have well-documented, portable, extensible APIs
for the functions that currently require access to the kernel symbol table
and /dev/kmem.  Perhaps stuff can be added to sysctl()... 

Computing the load average is a commonplace operation.  Many programs want
to do it to take different actions depending on how badly the system is loaded.
I know of many inet servers that do this.  However:

- You probably spend more time reading the kernel symbol table than you'd
  save by taking the action you'd take if the load was low.
- You require access to /dev/kmem (suid root or sgid kmem) which is an
  inherent security flaw that may develop into a hole.

Unless you are debugging a kernel, /dev/kmem should not even have to exist.

-- 
David Jones, M.A.Sc student, Electronics Group (VLSI), University of Toronto
           email: dej@eecg.toronto.edu, finger for PGP public key
         For a good time, telnet torfree.net and log in as `guest'.
          Click me!