mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: David Madore <david.madore@ens.fr>
Cc: Linux Kernel mailing-list <linux-kernel@vger.kernel.org>
Subject: Re: patch to make Linux capabilities into something useful (v 0.3.1)
Date: Fri, 8 Sep 2006 12:52:39 +0200	[thread overview]
Message-ID: <20060908105238.GB920@elf.ucw.cz> (raw)
In-Reply-To: <20060908041034.GB24135@clipper.ens.fr>

Hi!

> > You contradict yourself.
> 
> I don't see how that is.  I understand that you could be unconvinced
> by my reasoning and by my arguments, but I don't see how they are
> contradictory.

Well, you claim it is as safe as possible, and it is not quite. 

> The bottom line is that, whereas for root making syscalls fail (or,
> worse, in the case of setuid(), behave subtly diffently) is a radical
> change, for non-root it is something which should always be expected
> (fork() can fail for lack of resources, write() can fail for quota
> exhaution, etc.), and not something an attacker should be able to
> exploit.

I can bet someone will get the fork() case wrong:

f = fork();
kill(f);

fork will return -1, and kill will kill _all_ the processes.

> >			   Yes, you are decreasing security of suid
> > non-root programs, and yes, someone will take advantage of that. Plus,
> > you can easily do away without this risk.
> 
> I wish I could offer more assurance, but unfortunately the solutions
> which do away with the risk come with a great cost:
> 
> > Just add all "usual" capabilities when execing
> > suid/sgid-anything.
> 
> This makes it trivial to regain capabilities: just create a program
> suid yourself and exec it.  OK, we can say that "yourself" won't work,
> but you still only need to find another uid to hijack...  Not too

If you can find another uid to hijack, that other uid has bad
problems. And I do not think you'll commonly find another uid to
hijack.

And there are easier ways to get out of jail with your proposed
capabilities: you do not restrict ptrace, so you can just ptrace any
other process with same uid, and hijack it.

(You probably want to introduce CAP_REG_PTRACE).

Or just remove CAP_REG_XUID_EXEC when removing any other CAP_REG...?

> >		      Alternatively disallow suid/sgid-anything exec
> > when all "usual" capabilities are not present.
> 
> This is probably too stringent: remove any trivial capability
> whatsoever and you lose a rather important ability.

It is not too bad; you'll usually not want restricted programs to exec
anything setuid... (Do you have example where
restricted-but-should-be-able-to-setuid-exec makes sense?)
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2006-09-08 10:53 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-05 21:26 David Madore
2006-09-06  0:27 ` Casey Schaufler
2006-09-06 10:06   ` David Madore
2006-09-06 13:26     ` David Madore
2006-09-07  0:11       ` Casey Schaufler
2006-09-07  0:32         ` David Madore
2006-09-07  1:01           ` Casey Schaufler
2006-09-07  1:29             ` David Wagner
2006-09-07 16:00               ` Casey Schaufler
2006-09-07 18:33                 ` David Wagner
2006-09-07 17:34             ` David Madore
2006-09-07 19:38               ` Bernd Eckenfels
2006-09-07 23:00                 ` Pavel Machek
2006-09-08  1:22                   ` Bernd Eckenfels
2006-09-08 10:45                     ` Pavel Machek
2006-09-08 16:08                       ` Casey Schaufler
2006-09-08 14:39                     ` Pavel Machek
2006-09-08 19:10                       ` Bernd Eckenfels
2006-09-07 22:54               ` Pavel Machek
2006-09-08  4:10                 ` David Madore
2006-09-08 10:52                   ` Pavel Machek [this message]
2006-09-08 22:51                     ` David Madore
2006-09-09  0:11                       ` Casey Schaufler
2006-09-09 11:59                         ` Pavel Machek
2006-09-09 11:40                       ` Pavel Machek
2006-09-10 10:41                         ` David Madore
2006-09-10 13:06                           ` Pavel Machek
2006-09-10 14:25                             ` capability inheritance (was: Re: patch to make Linux capabilities into something useful (v 0.3.1)) David Madore
2006-09-10 22:42                               ` Pavel Machek
2006-09-11 16:00                               ` Casey Schaufler
2006-09-11 17:39                                 ` David Madore
2006-09-09  0:59                   ` patch to make Linux capabilities into something useful (v 0.3.1) David Wagner
2006-09-09 12:49                     ` David Madore
2006-09-09 23:18       ` Theodore Tso
2006-09-10 10:13         ` David Madore
2006-09-10 12:36         ` Pavel Machek
2006-09-10 23:24           ` Theodore Tso
2006-09-11  8:09             ` Pavel Machek
2006-09-06 18:25 ` Serge E. Hallyn
2006-09-06 22:27   ` David Madore
2006-09-07  0:04     ` David Madore
2006-09-07 23:06       ` Serge E. Hallyn
2006-09-08  4:16         ` David Madore
2006-09-07  6:43     ` Jan Engelhardt
2006-09-07 23:02     ` Serge E. Hallyn
2006-09-08  1:08       ` David Madore
2006-09-08  1:31         ` Serge E. Hallyn
2006-09-08 21:45           ` David Madore
2006-09-07 18:21 ` James Antill
2006-09-07 18:33   ` Kyle Moffett
2006-09-07 20:05     ` James Antill
2006-09-08  4:00   ` David Madore

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=20060908105238.GB920@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=david.madore@ens.fr \
    --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

all inboxes | Powered by JetHome®