9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ronald G Minnich <rminnich@lanl.gov>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Private Namespaces for Linux
Date: Tue, 20 Nov 2001 16:17:10 -0700	[thread overview]
Message-ID: <0111201617100H.13061@snaresland> (raw)
In-Reply-To: <20011120225405.6E1E219A77@mail.cse.psu.edu>

On Tuesday 20 November 2001 15:54, David Gordon Hogan wrote:
> Plan 9 doesn't even have set-uid.

Yeah I know. Those are the guys who made me realize set-uid was stupid, back
when I had no gray hairs.

> But I think you misunderstand.  There are two problems to
> be addressed: (1) rogue fileservers serving up set-uid files
> (not a problem for 9P, but relevant to Unix-based protocols
> like NFS...);

I'm probably missing something. Here is my understanding of how this all
goes. Bear in mind that the last time I thought about this at all was a while
back. I have not tested it on the latest Linux distributions.

I clear setuid bits in the client-side VFS. So you can't get a setuid to even
happen via the kernel exec, even if the bit could move over 9P, which it
can't.

For the libc hack, you are limited to what you can do from user mode, so I am
pretty sure that route is closed too, due to precautions taken in ld.so.
Recall that the libc hack simply redirects stuff like open() to a library,
which translates the ops to 9P and sends the request to a server. This really
depends on ld.so honoring LD_PRELOAD. It doesn't for setuid programs (at
least on systems I have used).

> (2) attacks like the following:
>
> 	$ bind /tmp/passwd /etc/passwd
> 	$ su

1) Kernel-mode VFS: The su will fail as it has no setuid bits.

2) User-mode libc hack: the behavior on systems I use is  that LD_PRELOAD has
    no effect
    on programs with setuid set, and stuff like LD_LIBRARY_PATH is ignored.
    That may have changed -- it should not have, since that was a very early
    sunos exploit ca. 1988 when they first did shared libraries (shared
     libraries are not my favorite thing either). You set LD_LIBRARY_PATH to
         somewhere bad, run su, voila! you're root.
    (I could look but probably these env variables are cleared in the kernel.
     I can't remember which OS I saw this on, but it gets done in some of
  them)

> Disallowing su, passwd, sendmail, etc etc isn't really a solution...

Well, Plan 9 doesn't need stuff like that. Linux shouldn't either, but sadly
it does. That's why I expect Unix-like OSes like Linux to die soon, but then
again I've been expecting that every year for a long time ... however
security is more in the front of people's minds lately. And the things I've
seen done to LInux for security are so ugly, when I see them, I ask people:
have you looked at Plan 9. (two answers: 1) what's that (95%); 2) but nobody
uses that, so you need our gross hacks (5%). )

Say, does anybody remember those same two responses for Unix?

Anyway for this project I decided to ditch priveleged ports and set-uid.
They're just a bad thing.

ron
p.s. check out the dynsys page at uwisc.edu for their discussion of handling
lingering processes under Condor that can commandeer other Condor processes.
They have a cute fix, but under Plan 9 it is totally unnecessary.


  reply	other threads:[~2001-11-20 23:17 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-20 22:54 David Gordon Hogan
2001-11-20 23:17 ` Ronald G Minnich [this message]
2001-11-20 23:49   ` Matthew Hannigan
2001-11-20 23:31 ` Alexander Viro
  -- strict thread matches above, loose matches on Subject: below --
2001-11-27  8:49 nigel
2001-11-27  7:24 nigel
2001-11-27  6:43 David Gordon Hogan
2001-11-27  3:09 Russ Cox
2001-11-27  8:13 ` Skip Tavakkolian
2001-11-27  3:03 geoff
2001-11-26 18:27 erik quanstrom
2001-11-26  5:31 David Gordon Hogan
2001-11-26 10:00 ` Thomas Bushnell, BSG
2001-11-26 10:48   ` Matt
2001-11-26 14:29     ` Ronald G Minnich
     [not found]     ` <Pine.LNX.4.33.0111260728070.16611-100000@snaresland.acl.la nl.gov>
2001-11-27  0:13       ` Andrew Simmons
2001-11-27  1:37         ` Ronald G Minnich
     [not found]         ` <Pine.LNX.4.33.0111261834400.19833-100000@snaresland.acl.la nl.gov>
2001-11-27  2:17           ` Andrew Simmons
2001-11-27  2:28             ` Boyd Roberts
2001-11-27  2:46               ` Andrew Simmons
2001-11-27 11:53             ` Ralph Corderoy
2001-11-27  2:22         ` Quinn Dunkan
2001-11-27  2:54           ` Andrew Simmons
2001-11-27  3:06             ` Boyd Roberts
2001-11-26 14:18 ` Ronald G Minnich
2001-11-26 18:26   ` Dan Cross
2001-11-22  0:42 rob pike
2001-11-22  0:36 rob pike
2001-11-21 23:02 rob pike
2001-11-21 23:26 ` Matt
2001-11-21 20:08 erik quanstrom
2001-11-21 16:49 forsyth
2001-11-21 14:52 presotto
2001-11-21 20:12 ` Dan Cross
2001-11-21 20:48 ` Skip Tavakkolian
2001-11-21 22:50   ` Andrew Simmons
2001-11-25 15:23   ` david presotto
2001-11-25  4:19     ` George Michaelson
2001-11-21  3:02 Eric Grosse
2001-11-21  1:29 okamoto
2001-11-21  3:46 ` Ronald G Minnich
     [not found] ` <Pine.LNX.4.33.0111202037460.14857-100000@snaresland.acl.la nl.gov>
2001-11-21 17:51   ` Skip Tavakkolian
2001-11-21 22:44     ` Ronald G Minnich
2001-11-21  0:03 David Gordon Hogan
2001-11-20 23:48 forsyth
2001-11-20 23:40 David Gordon Hogan
2001-11-20 23:45 ` Alexander Viro
2001-11-20 23:54 ` Matthew Hannigan
2001-11-21 17:24 ` Thomas Bushnell, BSG
2001-11-22  9:56 ` Thomas Bushnell, BSG
2001-11-20 22:40 David Gordon Hogan
2001-11-20 22:47 ` Ronald G Minnich
2001-11-20 23:29 ` Alexander Viro
2001-11-20 22:20 presotto
2001-11-20 22:08 David Gordon Hogan
2001-11-20 23:40 ` Dan Cross
2001-11-21 15:05 ` Boyd Roberts
2001-11-20 22:05 erik quanstrom
2001-11-20 21:24 David Gordon Hogan
2001-11-20 21:49 ` Ronald G Minnich
2001-11-20 20:54 presotto
2001-11-20 20:49 David Gordon Hogan
2001-11-20 20:57 ` Ronald G Minnich
2001-11-21  5:59   ` Taj Khattra
2001-11-20 10:22 forsyth
2001-11-19 21:46 [9fans] vmware Russ Cox
2001-11-19 23:59 ` [9fans] Private Namespaces for Linux Matt
2001-11-20  5:26   ` Ronald G Minnich
2001-11-20 17:28   ` Thomas Bushnell, BSG
2001-11-20 20:46     ` Ronald G Minnich
2001-11-20 21:08       ` Alexander Viro
2001-11-20 21:48         ` Ronald G Minnich
2001-11-20 22:28           ` Ronald G Minnich
2001-11-20 23:14             ` Alexander Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0111201617100H.13061@snaresland \
    --to=rminnich@lanl.gov \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).