From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jerry Haltom <wasabi@larvalstage.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: setpeuid(pid_t, uid_t) proposal
Date: Sat, 28 Aug 2004 20:15:28 +0100 [thread overview]
Message-ID: <1093353063.2810.8.camel@localhost.localdomain> (raw)
In-Reply-To: <1093323005.1248.21.camel@localhost>
On Maw, 2004-08-24 at 05:50, Jerry Haltom wrote:
> One of the problems that I've been presented with regularly when working
> with Linux (and Unix in particular) is the lack of what other operating
> systems call "impersonation". The ability of one process not running as
> root to assume the identity (for a limited time) of another user ID.
> Securely.
For the file system case there is setfsuid. You can also make use
of seperate effective/real/saved uids through setreuid() and friends.
setfsuid() also addresses the other problem - if a process switches
fully to my ID then I can play with it - kill it etc.
> These problems would be solved if Apache could run as the user that was
> requesting access on the server: given shared user accounts. It would
> only have access to what it needs to have access to.
This is actually not hard to do if your server is designed to be a
little smarter. The apache model doesn't fit it well although apache
could make some use of setfsuid() as unfsd (user mode nfsd does) and it
does support doing this through suexec.
One little non-obvious trick that might make this work faster would be
to keep track of running webdav servers for each active user and use
a redirect from the main server to communicate with it, and when the
client has idled out to reclaim it and hand the port back to the main
server instance so that users get redirected again
> That's just one use case... there are a number of others. Such as a
> secure "Run As" feature for desktop users... FTP servers, SSH could even
> use it to totally remove the need for any root presence. There are a
> number of possibilities. Too many to list. Use your imagination.
sshd can already do this. The "run as root" desktop feature already
exists using the existing auth functionality (see "usermode")
> Anyways, the function required is pretty simple. I'd like some of you
> wizzes to tell me what's wrong with my thinking.
Actually its easy to implement and horrible to get right - there is no
locking on uid changes. When a task is in a syscall the entire syscall
knows that the security for the process will not be changing.
> In the mean time, I'm working on implementing this right now to see how
> it goes. But this is my first actual kernel hacking, so we'll see. ;)
Have fun - the security stuff is hard but getting something working as
you describe for learning purposes and armwaving that issue should be
nice little project.
Alan
prev parent reply other threads:[~2004-08-28 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-24 4:50 setpeuid(pid_t, uid_t) proposal Jerry Haltom
2004-08-24 5:58 ` Valdis.Kletnieks
2004-08-24 6:27 ` Jerry Haltom
2004-08-24 12:01 ` Valdis.Kletnieks
2004-08-24 13:30 ` Gianni Tedesco
2004-08-28 19:15 ` Alan Cox [this message]
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=1093353063.2810.8.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=wasabi@larvalstage.net \
/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