All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Lawrence <slawrence@tresys.com>
To: Dominick Grift <dominick.grift@gmail.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: secilc: is anyone able to confirm that type_change ...
Date: Tue, 8 Jul 2014 15:21:31 -0400	[thread overview]
Message-ID: <53BC44BB.6000708@tresys.com> (raw)
In-Reply-To: <1404744312.9852.55.camel@x220.localdomain>

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.

So the temporary solution is to reorder your class statements so that
they are in the order defined in flask.h [1] so they get the right values.

The long term solution is to add a new statement to CIL (classorder,
similar to sidorder) that defines this order, allowing the class
definitions to appear in any order.

Thanks,
- Steve

[1]
https://github.com/SELinuxProject/selinux/blob/master/libselinux/include/selinux/flask.h

  reply	other threads:[~2014-07-08 19:21 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 [this message]
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
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=53BC44BB.6000708@tresys.com \
    --to=slawrence@tresys.com \
    --cc=dominick.grift@gmail.com \
    --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.