From: mgream@acacia (Matthew Gream) Subject: Re: top suid - security hole? Date: 28 Sep 1992 03:58:21 GMT
Rafal Kustra (summer student) (rafal@utstat.uucp) wrote:
:
: My ps, top and stuff are suid. This is so they can read
: /dev/kmem. Now top allows you to kill. With suid set
: anyone can kill init ! Not a best sol'n. So where did I
: go wrong ?
: On my system at school top is also suid and kmem is 640.
: But their top does'n allow killing - of course (or the
: anarchist part of me would try kill -9 1 !)
: Please answer : should I change kmem 644 or what ?
No need to set it setuid, make it setgid, as example (dumps from
my system) :
-r-x--s--x 1 root mem 17408 Sep 22 18:50 top
-r-x--s--x 1 root mem 13312 Sep 22 18:50 tload
-r-x--s--x 1 root mem 13312 Sep 22 18:50 free
-r-x--s--x 2 root mem 13312 Sep 22 18:50 w
-r-x--s--x 1 root mem 17408 Sep 22 18:50 ps
-r-x--s--x 2 root mem 13312 Sep 22 18:50 uptime
-rw-r----- 1 root mem 26900 Sep 26 18:59 /etc/psdatabase
crw-r----- 1 root mem 1, 2 Jul 30 19:31 /dev/kmem
crw-rw---- 1 root mem 1, 1 Jul 30 19:31 /dev/mem
^ not sure if I need that however.
Works fine me :-) [ I try not to make anything setuid, setgid if
possible]