From: Stephen Smalley <sds@tycho.nsa.gov>
To: Daniel J Walsh <dwalsh@redhat.com>,
Steve Lawrence <slawrence@tresys.com>,
Dominick Grift <dominick.grift@gmail.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: secilc: is anyone able to confirm that type_change ...
Date: Wed, 09 Jul 2014 11:18:59 -0400 [thread overview]
Message-ID: <53BD5D63.5090908@tycho.nsa.gov> (raw)
In-Reply-To: <53BD5B4A.5070405@redhat.com>
On 07/09/2014 11:10 AM, Daniel J Walsh wrote:
>
> On 07/08/2014 03:35 PM, Stephen Smalley wrote:
>> On 07/08/2014 03:21 PM, Steve Lawrence wrote:
>>> On 07/07/2014 10:45 AM, Dominick Grift wrote:
>>>> On Mon, 2014-07-07 at 16:24 +0200, Dominick Grift wrote:
>>>>> On Mon, 2014-07-07 at 10:00 -0400, Steve Lawrence wrote:
>>>>>
>>>>>> I can't reproduce the problem with my test policies. The typechange
>>>>>> statements look like they are correctly inserted into the binary and I
>>>>>> am seeing the expected type changes at runtime.
>>>>>>
>>>>>> Is this with your monogam policy?
>>>>>>
>>>>> No, that one is no longer maintained.
>>>>>
>>>>> It is this very small base policy:
>>>>>
>>>>> https://github.com/doverride/e145
>>>>>
>>>> Note though, with that version, that there is no type_change rule from
>>>> devpts_t to device_session_pts_t currently (so if you were to test this
>>>> with sshd then it would be lacking the type change rule)
>>>>
>>>> Either insert that type_change rule manually or test it with the (local)
>>>> login program since there is a type_change session_t
>>>> device_tty_t:chr_file device_session_tty_t rule present.
>>>>
>>>> There is also a conditional type change rule for console_device_t to
>>>> device_session_tty_t.
>>>>
>>>> I cannot imagine me having overlooked anything. Since there are only two
>>>> domains (system_t and session_t), and both are virtually unconfined.
>>>>
>>>>
>>> Ok, finally managed to track down this issue. Turns out to be an
>>> ordering problem. You have your classes listed in alphabetical order.
>>> Order shouldn't matter with CIL and everything should work correctly,
>>> and in most cases is does. However, we assign integer values to each
>>> class based on the order we see them. So the first one we see gets value
>>> 1, second gets 2, etc. If these values don't match up with what
>>> userspace and the kernel expect them to be, things break.
>> Kernel and newer userspace code performs dynamic lookup of class/perm
>> values from strings and handles mapping their own internal indices to
>> the policy-defined values. So this points to a need to update
>> pam_selinux and other older code to map via string_to_security_class().
> Lets open a bugzilla on this.
Probably need to crawl the fedora source tree and look for any #include
<selinux/flask.h> or #include <selinux/av_permissions.h> references to
identify all packages that need to be updated. For permission checks,
can just switch over to using selinux_check_access() in most cases and
then all the string lookups are handled for you as well as all of the
ugliness of dealing with the AVC. May want new wrapper functions for
security_compute_* that take the class as a string and internally call
string_to_security_class() that can be used instead.
next prev parent reply other threads:[~2014-07-09 15:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-05 12:39 secilc: is anyone able to confirm that type_change Dominick Grift
2014-07-06 13:12 ` Dominick Grift
2014-07-07 14:00 ` Steve Lawrence
2014-07-07 14:24 ` Dominick Grift
2014-07-07 14:45 ` Dominick Grift
2014-07-08 19:21 ` Steve Lawrence
2014-07-08 19:31 ` Dominick Grift
2014-07-08 19:35 ` Stephen Smalley
2014-07-09 15:10 ` Daniel J Walsh
2014-07-09 15:18 ` Stephen Smalley [this message]
2014-07-09 15:35 ` Stephen Smalley
2014-07-09 21:37 ` Daniel J Walsh
2014-07-09 15:31 ` Daniel J Walsh
2014-07-09 15:37 ` Dominick Grift
2014-07-09 16:01 ` Stephen Smalley
2014-07-09 16:14 ` Dominick Grift
2014-07-09 18:45 ` Stephen Smalley
2014-07-09 16:15 ` James Carter
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=53BD5D63.5090908@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=dominick.grift@gmail.com \
--cc=dwalsh@redhat.com \
--cc=selinux@tycho.nsa.gov \
--cc=slawrence@tresys.com \
/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.