public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Geoffrey McRae <geoff@rabidhost.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: New Security Features, Please Comment
Date: Wed, 03 Dec 2008 12:44:17 +1100	[thread overview]
Message-ID: <1228268657.6679.4.camel@lappy.spacevs.com> (raw)
In-Reply-To: <20081203005338.6472db7a@lxorguk.ukuu.org.uk>

On Wed, 2008-12-03 at 00:53 +0000, Alan Cox wrote:
> > (such as PHP) as the user that owns the website we are forced to fork a
> > new process per request, then call setuid/gid and then launch the script
> > language. This ofcource is resource intensive, but at present there is
> > no other solution.
> 
> It's pretty much the minimal requirement for any kind of security because
> you need the separate process/file environment. It's not helped by the
> fact some of the scripting languages don't support an internal fork/exec
> that preserves bootstrapped interpreter state but that is a different
> problem.
> 

But once this set is introduced a HTTP server could be written that uses
forked children to handle requests, that have their identity swtiched
before doing any work, including parsing CGI scripts.

This does not only apply to HTTP servers though, there are many cases
where it is nessacary to become a user, ie, to deliver email to the
user's home directory.

> > child processes (forked) uid/gid at any time without needing root access
> > while being secure so that it can not set its child processes to users
> > such as root.
> 
> You then need locking to handle all the horrible corner cases such as
> changing uid during a file open. You really really want a process to
> change its own uid somehow, even if that is done by some method other
> than setuid.

The idea is to not allow the child to change its own uid, or give the
child any elevated privlages so that should the child be compromised via
buffer overflow or some other bug, it cant be abused.

> 
> Models that have been talked about but not implemented have included
> things like passing 'authority' of some kind by file handles, so the
> child receives an authority and then uses it.
> 
> Alan

I would welcome more information as to how this can break applications
as I am very new to kernel hacking and would like to solve this
performance vs security problem once and for all.

-Geoff.


  reply	other threads:[~2008-12-03  1:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 23:28 New Security Features, Please Comment Geoffrey McRae
2008-12-03  0:24 ` Geoffrey McRae
2008-12-03  0:53 ` Alan Cox
2008-12-03  1:44   ` Geoffrey McRae [this message]
2008-12-03  2:11     ` David Newall
2008-12-03  2:55     ` Valdis.Kletnieks
2008-12-03  4:02       ` Geoffrey McRae
2008-12-03  4:35         ` Peter Teoh
2008-12-03  5:02           ` Geoffrey McRae
2008-12-03  6:54             ` David Newall
2008-12-03 10:29     ` Alan Cox
2008-12-03 12:42     ` Nick Andrew
2008-12-03 12:46       ` Alan Cox
2008-12-03 22:44       ` Geoffrey McRae
2008-12-03 23:08         ` Alan Cox
2008-12-03 23:27           ` Peter Teoh
2008-12-03 23:40             ` Geoffrey McRae
2008-12-04 21:56               ` Valdis.Kletnieks
2008-12-04 22:30                 ` Geoffrey McRae
2008-12-05  3:35                   ` Valdis.Kletnieks
2008-12-05  3:44                     ` Nick Andrew
2008-12-05  3:50                     ` Geoffrey McRae
2008-12-05  4:03                       ` Valdis.Kletnieks
2008-12-03 23:39           ` Miquel van Smoorenburg
2008-12-04  0:00             ` Geoffrey McRae
2008-12-04  0:22               ` Peter Teoh
2008-12-04  0:08             ` Alan Cox

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=1228268657.6679.4.camel@lappy.spacevs.com \
    --to=geoff@rabidhost.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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