Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* OSF/1 2.0: why setuid bit everywhere?
@ 1994-08-18 21:55 Ronnie L. Killough
  1994-08-24 15:21 ` Shawn Mamros
  1994-08-24 20:04 ` Phil Knaack
  0 siblings, 2 replies; 5+ messages in thread
From: Ronnie L. Killough @ 1994-08-18 21:55 UTC (permalink / raw)


Why does OSF/1 2.0 have the user-setuid (to root) bit set on so many
executables?  Examples are the "ps" command, X window executables xterm,
dxterm, and dxpause, I could probably find others. 

Just looks suspicious to me.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OSF/1 2.0: why setuid bit everywhere?
  1994-08-18 21:55 OSF/1 2.0: why setuid bit everywhere? Ronnie L. Killough
@ 1994-08-24 15:21 ` Shawn Mamros
  1994-08-24 20:16   ` Phil Knaack
  1994-08-24 20:04 ` Phil Knaack
  1 sibling, 1 reply; 5+ messages in thread
From: Shawn Mamros @ 1994-08-24 15:21 UTC (permalink / raw)


ronniek@pegasus.NoSubdomain.NoDomain(?) (Ronnie L. Killough) writes:
>Why does OSF/1 2.0 have the user-setuid (to root) bit set on so many
>executables?  Examples are the "ps" command, X window executables xterm,
>dxterm, and dxpause, I could probably find others. 
>
>Just looks suspicious to me.

The examples you cite aren't so suspicious, when you consider what they
have to do:

ps: open /dev/kmem (or perhaps the "files" in /proc) for reading.
{d,}xterm: open and manipulate pseudo-ttys.
dxpause: read from the passwd file or the root-only enhanced security
         database.

It seems to me that ps and dxpause could be made to work setgid instead
of setuid, if appropriate groups were given ownership and read-only
capabilities on /dev/kmem and the enhanced security database.  But there
may be other issues there of which I'm not aware...

-Shawn Mamros
E-mail to: mamros@ftp.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OSF/1 2.0: why setuid bit everywhere?
  1994-08-18 21:55 OSF/1 2.0: why setuid bit everywhere? Ronnie L. Killough
  1994-08-24 15:21 ` Shawn Mamros
@ 1994-08-24 20:04 ` Phil Knaack
  1 sibling, 0 replies; 5+ messages in thread
From: Phil Knaack @ 1994-08-24 20:04 UTC (permalink / raw)


In <778@trident.datasys.swri.edu>
	ronniek@pegasus.NoSubdomain.NoDomain (Ronnie L. Killough) writes:

>Why does OSF/1 2.0 have the user-setuid (to root) bit set on so many
>executables?  Examples are the "ps" command, X window executables xterm,
>dxterm, and dxpause, I could probably find others. 

Things with the suid bit are processes run by users that must have
special priveleges in order to work. For example, ps needs to access
things like /dev/mem and /dev/kmem, which, of course, the normal user
can't open and read (thank god). Xterm and others must have root access
to write to /etc/utmp, which is the file that maintains a list of who is
logged on what tty, their idle times, etc .. a normal user can't access
this either. But the executable sets its own ID to root just long enough
to read the information, then sets it back to the user's ID when there
is any interaction with the user that might be a security hole. ``top''
is also setuid, but of course it switches back to the user's ID before
allowing execution of the ``kill'' command.

And even if a user could write to a suid binary file, as soon as he
writes to it, the suid bit is turned off by the kernel .. 

>Just looks suspicious to me.

Well, you could change them all to non-suid, I suppose .. but then
again, a lot of things would break (unless you gave /dev/mem and
/dev/kmem and /etc/utmp and everything else world writable access, and
next thing you know, you have a multi-user DOS box .. ;)

Cheers,
Phil
-- 
Phil Knaack, WGA		296-2735		flipk@iastate.edu
Sociology Department		1304 Florida #3		flipk@vorpal.com
311 East Hall, 296-4869		Ames IA 5014		flipk@cs.iastate.edu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OSF/1 2.0: why setuid bit everywhere?
  1994-08-24 15:21 ` Shawn Mamros
@ 1994-08-24 20:16   ` Phil Knaack
  1994-08-24 23:56     ` Marc Fraioli
  0 siblings, 1 reply; 5+ messages in thread
From: Phil Knaack @ 1994-08-24 20:16 UTC (permalink / raw)


In <940824112139@cavedog.ftp.com> mamros@ftp.com  (Shawn Mamros) writes:

>It seems to me that ps and dxpause could be made to work setgid instead
>of setuid, if appropriate groups were given ownership and read-only
>capabilities on /dev/kmem and the enhanced security database.  But there
>may be other issues there of which I'm not aware...

There is nothing wrong with this method, in fact a number of systems do
it this way. It's just that OSF has chosen not to. In the case of NetBSD
(the system with which I am most familar, above OSF):

-r-xr-sr-x  1 bin   kmem    147456 Aug 23 18:03 /bin/ps
crw-r-----  1 root  kmem    2,   1 Aug  1 01:32 /dev/kmem

ps is setgid only, to the group kmem. notice also that this is the kmem
version of ps, there is also a version of ps which uses the /proc
filesystem. The point of the /proc filesystem is that these processes
need not have -any- priveleges to access them. all subdirectories of
/proc (which are PID numbers) are owned by the owner of the process, and
are mode 555.

fstat, ipcs, lpq, lpr, lprm, modstat, nfsstat, uptime, vmstat, w, wall,
and write are several other examples of this.

It's all moot though, anyway, since OSF does this for a very tiny number
of utilities, and this -is- an OSF newsgroup, so I'll shut up now ;)

Cheers,
Phil
-- 
Phil Knaack, WGA		296-2735		flipk@iastate.edu
Sociology Department		1304 Florida #3		flipk@vorpal.com
311 East Hall, 296-4869		Ames IA 5014		flipk@cs.iastate.edu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OSF/1 2.0: why setuid bit everywhere?
  1994-08-24 20:16   ` Phil Knaack
@ 1994-08-24 23:56     ` Marc Fraioli
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Fraioli @ 1994-08-24 23:56 UTC (permalink / raw)


In article 777759389@soclab.soc.iastate.edu,  flipk@iastate.edu (Phil Knaack) writes:
>In <940824112139@cavedog.ftp.com> mamros@ftp.com  (Shawn Mamros) writes:
>
>>It seems to me that ps and dxpause could be made to work setgid instead
>>of setuid, if appropriate groups were given ownership and read-only
>>capabilities on /dev/kmem and the enhanced security database.  But there
>>may be other issues there of which I'm not aware...
>
>There is nothing wrong with this method, in fact a number of systems do
>it this way. It's just that OSF has chosen not to. 
[example nixed]

While this should work for ps, I don't believe it will work for dxpause
on DEC OSF/1.  This is because if you switch to enhanced security, the
database is actually read through a system (or library?) call, rather than
by directly reading the files in the database, and that call will return 
only an error unless euid == 0.  I think this is a somewhat poor design, BTW. 
I was hoping to port xlock to OSF/1 w. enhanced security, but basically gave
up because that design choice would force me to make xlock suid to root,
which I don't trust it enough to do.  I prefer the method that Sun chose
for Solaris 2 and NIS+, wherein users can see their own password (encrypted),
but no one else's, and xlock can run without setuid.  I believe NIS+
achieves this with some sort of DES-based public-key authentication, so
even root can't poke at stuff you don't want it to.  This solves the old
NIS problem where remote sites can grab your passwords just by guessing
your domain name.

comp.security.unix added to newsgroups:

---
Marc Fraioli	      | "They couldn't hit an elephant at this dist- " 
mjf@clark.net         |    - Last words of Union General John Sedgwick,
		      |	   Battle of Spotsylvania Court House, U.S. Civil War




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1994-08-24 23:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-08-18 21:55 OSF/1 2.0: why setuid bit everywhere? Ronnie L. Killough
1994-08-24 15:21 ` Shawn Mamros
1994-08-24 20:16   ` Phil Knaack
1994-08-24 23:56     ` Marc Fraioli
1994-08-24 20:04 ` Phil Knaack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox