home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!hela.iti.org!cs.widener.edu!eff!world!ksr!zdenek
- From: zdenek@ksr.com (Zdenek Radouch)
- Newsgroups: comp.os.linux
- Subject: ps and /dev/kmem
- Message-ID: <20234@ksr.com>
- Date: 18 Dec 92 12:01:57 EST
- References: <1992Dec18.063831.24368@news.stolaf.edu>
- Sender: news@ksr.com
- Organization: Kendall Square Research Corp.
- Lines: 42
-
- >yes, it is "yet another /proc ps".
- >
- >I took the classic /dev/kmem ps, the perl /proc ps, and the simple c
- >/proc ps posted recently, and made one c /proc ps.
- >
- >The interface and output is that of the /dev/kmem ps, and the guts are
- >those of the simple c /proc ps (but majorly revised). Unfortunately,
- >/proc is not quite up to fulfilling the role of /dev/kmem, but if I
- >start hacking on the kernel tomorrow, it may come closer ;-)
-
- [...]
-
- >I just like a ps that doesn't require a
- >namelist file, and that doesn't have to be suid or sgid, and is thus
- >not a security risk, and doesn't have to be recompiled and updated all
- >the time.
-
- Most of the modern unix or unix like implementations avoid using
- /dev/kmem kind of interface exactly for the above reasons.
- In the absence of a standard interface it is still much cleaner
- to devise your own kernel interface. When a standard interface is defined
- you can either revise your interface, or insert a user space conversion
- layer between your interface and the user.
-
- It might be OK to keep recompiling user code on a hacker's system,
- but any commercial release tries to avoid touching the user code
- during system updates.
-
- If you want a really BAD example of what happens when one hacks /dev/kmem
- look no further than GNUmake. GNUmake needs access to the machine loading info,
- and it was designed to retrieve it from /dev/kmem rather than using a generic
- module that would retrieve it from wherever it can. This resulted in a design
- where GNUmake must run with euid=0 (at least at times that it accesses kmem),
- and toggle uid back whenever it touches real files. This is unfortunately
- impossible to do with a single executable (you need two, one suid) under POSIX
- or Sys V, so GNUmake will not work on these machines. The bad part is that
- since the whole /dev/kmem concept was so tightly built in, there is no way
- to fix this easily, a fix would require a major redesign and consequently
- they (FSF) won't even address this issue.
-
- my $.02
- -Z
-