public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@gentoo.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	David Madore <david.madore@ens.fr>,
	Linux Kernel mailing-list <linux-kernel@vger.kernel.org>,
	LSM mailing-list <linux-security-module@vger.kernel.org>
Subject: Re: [PATCH 3/4] security: capabilities patch (version 0.4.4), part 3/4: introduce new capabilities
Date: Sun, 17 Sep 2006 16:39:16 -0400	[thread overview]
Message-ID: <450DB274.1010404@gentoo.org> (raw)
In-Reply-To: <20060917181422.GC2225@elf.ucw.cz>

Pavel Machek wrote:
> Hi!
>
>   
>>>> Introduce six new "regular" (=on-by-default) capabilities:
>>>>
>>>> * CAP_REG_FORK, CAP_REG_OPEN, CAP_REG_EXEC allow access to the
>>>>   fork(), open() and exec() syscalls,
>>>>    
>>>>         
>>> CAP_REG_EXEC seems meaningless, I can do the same with mmap by hand for
>>> most types of binary execution except setuid (which is separate it
>>> seems)
>>>
>>> Given the capability model is accepted as inferior to things like
>>> SELinux policies why do we actually want to fix this anyway. It's
>>> unfortunate we can't discard the existing capabilities model (which has
>>> flaws) as well really.
>>>       
>
>   
>> To expand on this a little, some of the capabilities you are looking to 
>> add are of very little if any use without being able to specify objects. 
>> For example, CAP_REG_OPEN is whether the process can open any file 
>> instead of specific ones. How many applications open no files whatsoever 
>> in practice? 
>>     
>
> Filters, for example. gzip -9 - and such stuff does not need to open
> any files. These should be easy to lock down, and still very useful.
>
> More applications could be made lock-down-aware, and for example ask
> master daemon to open files for them over a (already opened) socket.
>
>   
Unlikely.. As Jan pointed out in the last thread anything that links 
against glibc does a dozen opens on invocation:
[jbrindle@twoface ~]$ strace -eopen gzip -9 -   
open("/usr/lib64/fglrx/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
open("/usr/lib64/fglrx/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such 
file or directory)
open("/usr/lib64/fglrx/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such 
file or directory)
open("/usr/lib64/fglrx/libc.so.6", O_RDONLY) = -1 ENOENT (No such file 
or directory)
open("/usr/lib/fglrx/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No 
such file or directory)
open("/usr/lib/fglrx/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file 
or directory)
open("/usr/lib/fglrx/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such 
file or directory)
open("/usr/lib/fglrx/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/libc.so.6", O_RDONLY)      = 3
gzip: compressed data not written to a terminal. Use -f to force 
compression.
For help, type: gzip -h
Process 17519 detached

this wouldn't be able to run if it couldn't open libc.so so you'd be 
limited to static binaries (with statically linked libs that don't do 
any open() calls) that don't do any kind of name resolution (ip, uid), 
have no config files, etc. very limited.. and my other point was that 
even if you did have said binary (the limitations make this very 
unlikely though) the binary could never be changed to open a file since 
it would then get all open access since capabilities are not fine grained.

The benefits of this are so minuscule and the cost is so high if you are 
ever to use it that it simply won't happen..

Joshua Brindle

  reply	other threads:[~2006-09-17 20:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-10 13:37 [PATCH 1/4] security: capabilities patch (version 0.4.4), part 1/4: enlarge capability sets David Madore
2006-09-10 13:41 ` [PATCH 2/4] security: capabilities patch (version 0.4.4), part 2/4: change inheritance semantics David Madore
2006-09-10 13:42 ` [PATCH 3/4] security: capabilities patch (version 0.4.4), part 3/4: introduce new capabilities David Madore
2006-09-10 16:23   ` Alan Cox
2006-09-10 16:09     ` David Madore
2006-09-11  8:06       ` James Morris
2006-09-11 12:03         ` Joshua Brindle
2006-09-11 16:22           ` Casey Schaufler
2006-09-17 18:06           ` Pavel Machek
2006-09-10 17:56     ` Joshua Brindle
2006-09-10 20:03       ` David Madore
2006-09-11  6:10         ` Jan Engelhardt
2006-09-11  6:51           ` David Madore
2006-09-11 13:42         ` Stephen Smalley
2006-09-17 18:14       ` Pavel Machek
2006-09-17 20:39         ` Joshua Brindle [this message]
2006-09-17 21:16           ` David Madore
2006-09-18 11:46             ` Joshua Brindle
2006-09-18 11:58               ` David Madore
2006-09-18 12:04               ` Pavel Machek
2006-09-18 12:12                 ` Joshua Brindle
2006-09-18 16:02               ` Casey Schaufler
2006-09-19  0:25                 ` Joshua Brindle
2006-09-19  3:46                   ` Casey Schaufler
2006-09-19  4:09                     ` Joshua Brindle
2006-09-19 15:54                       ` Casey Schaufler
2006-09-19 18:27                   ` Pavel Machek
2006-09-10 13:44 ` David Madore
2006-09-10 13:46 ` [PATCH 4/4] security: capabilities patch (version 0.4.4), part 4/4: add filesystem support 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=450DB274.1010404@gentoo.org \
    --to=method@gentoo.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=david.madore@ens.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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