From: Daniel J Walsh <dwalsh@redhat.com>
To: sds@tycho.nsa.gov
Cc: Russell Coker <russell@coker.com.au>,
James Morris <jmorris@namei.org>,
Valdis.Kletnieks@vt.edu, SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Changes to policycoreutils.
Date: Tue, 21 Mar 2006 14:12:13 -0500 [thread overview]
Message-ID: <4420500D.1040106@redhat.com> (raw)
In-Reply-To: <1142875531.16487.93.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Mon, 2006-03-20 at 10:51 -0500, Stephen Smalley wrote:
>
>> restorecond, restorecon, and setfiles could benefit from a rewrite to
>> follow the more paranoid conventions of other programs that walk the
>> file tree (e.g. look at coreutils programs like rm -r logic, which has
>> been modified a number of times in response to security-related issues).
>> To date, restorecon and setfiles have simply relied on policy to
>> prevent:
>> - untrustworthy domains from creating hard links to files that they
>> shouldn't be able to access in the first place, and
>> - restorecon/setfiles from following untrustworthy symlinks.
>>
>> And we originally only expected setfiles to be applied upon
>> installation, not for normal runtime operation.
>>
>> But the code itself could provide stronger safeguards against the
>> threat, particularly now that you are automating the invocation of
>> restorecon-like functionality in response to user events. Again, look
>> to what has been done already in coreutils and elsewhere. There are
>> also recently added new syscalls to help reduce races in walking the
>> file tree (i.e. openat and friends) - possibly there should be some for
>> lsetxattr as well so that lsetfileconat() could be implemented?
>>
>> Under strict policy, the policy restrictions over creating hard links
>> and over following sym links help counter the risk. Under targeted
>> policy, users are unconfined by TE, so there is no direct benefit to a
>> malicious user in tricking restorecond into relabeling a file to a
>> different type. But now that users are supposed to be limited by MCS
>> restrictions in -targeted, you have to consider the risk that a
>> malicious user might try to use this avenue to get MCS categories
>> dropped from some target file so that he can access it.
>>
>
> BTW, on the FreeBSD side, they appear to have ported/rewritten the
> setfiles logic in their setfmac utility,
> http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/setfmac/setfmac.c
>
> They chose to use fts(3) rather than nftw(3) to walk the file tree, and
> use fts_accpath to access the file from the current directory.
>
>
Yes this would be a good idea, since we could do the equivalent of find
-prune, when we encounter a file system that does not support extended
attributes.
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-03-21 19:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-17 21:39 Changes to policycoreutils Daniel J Walsh
2006-03-18 5:32 ` Valdis.Kletnieks
2006-03-18 16:54 ` Daniel J Walsh
2006-03-20 13:45 ` Stephen Smalley
2006-03-20 14:51 ` Daniel J Walsh
2006-03-20 15:51 ` Stephen Smalley
2006-03-20 17:25 ` Stephen Smalley
2006-03-21 19:12 ` Daniel J Walsh [this message]
2006-03-20 20:27 ` Russell Coker
2006-03-20 20:47 ` Stephen Smalley
2006-03-20 20:11 ` Stephen Smalley
2006-03-20 21:23 ` Daniel J Walsh
2006-03-20 21:45 ` Stephen Smalley
2006-03-21 13:56 ` Stephen Smalley
2006-03-21 16:13 ` Daniel J Walsh
2006-03-20 21:26 ` Stephen Smalley
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=4420500D.1040106@redhat.com \
--to=dwalsh@redhat.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=jmorris@namei.org \
--cc=russell@coker.com.au \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.