All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <jbrindle@tresys.com>
To: Daniel J Walsh <dwalsh@redhat.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>, SE Linux <selinux@tycho.nsa.gov>
Subject: Re: The sort algorithm is broken by the second rule,  We need a way to pin these rules to the top.
Date: Fri, 31 Mar 2006 10:17:01 -0500	[thread overview]
Message-ID: <442D47ED.6040007@tresys.com> (raw)
In-Reply-To: <442D4448.2090700@redhat.com>

Daniel J Walsh wrote:
> Joshua Brindle wrote:
>> Daniel J Walsh wrote:
>>> /usr(/.*)?/lib(64)?(/.*)?            
>>> gen_context(system_u:object_r:lib_t,s0)
>>> /usr(/.*)?/lib(64)?/.*\.so(\.[^/]*)*    --    
>>> gen_context(system_u:object_r:shlib_t,s0)
>>>
>>> The following has to follow the one above.
>>>
>>> /usr/lib(64)?/libglide3\.so.*         --    
>>> gen_context(system_u:object_r:textrel_shlib_t,s0)
>>>
>>>
>>> It did in FC4, now it does not.  This is the second bug I have seen 
>>> caused by the sort algoritm.  We need a way to secify a primary File 
>>> Context file that will not be sorted but will always be at the top.  
>>> Then the rest can be sorted.
>>>
>>> Maybe we do not sort files within a particular fc file.  I do not 
>>> know. but this is broken.
>>>
>>
>> We are preparing to send up a patch that adds file context ordering to 
>> libsemanage ala the algorithm in fc_sort.c in refpolicy/support. The 
>> sort algorithm should put the 3rd entry below the top two because the 
>> stem length is greater. Are you seeing this with strict (and hightly 
>> modular policy?) the large base.pp from targeted will already have its 
>> file context entries sorted by fc_sort.c and should handle this case.
> I am only looking at targeted and MLS right now.   As soon as we get 
> this fix we need to get it out.
> 
hrm, the libsemanage fix shouldn't affect targeted since it is merely 
replicating the algorithm already used when the base.pp is built by 
refpolicy. The longer stem (of the 3rd entry) should win.

Please note that the sorting algorithm is very much heuristic and not 
perfect. In the discussions we've had around here about this we 
determined that the correct solution is to make the regexes more 
specific where possible.

--
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.

  reply	other threads:[~2006-03-31 15:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-31 14:50 The sort algorithm is broken by the second rule, We need a way to pin these rules to the top Daniel J Walsh
2006-03-31 14:57 ` Joshua Brindle
2006-03-31 15:01   ` Daniel J Walsh
2006-03-31 15:17     ` Joshua Brindle [this message]
2006-03-31 16:01       ` Christopher Ashworth
2006-03-31 19:27       ` Stephen Smalley
2006-03-31 15:17     ` Stephen Smalley
2006-03-31 15:20       ` Stephen Smalley
2006-03-31 15:10   ` Stephen Smalley
2006-03-31 16:35     ` Ivan Gyurdiev
2006-03-31 17:26       ` Ivan Gyurdiev
2006-04-02 11:32         ` Ivan Gyurdiev
2006-03-31 18:52       ` Stephen Smalley
2006-03-31 19:03         ` Ivan Gyurdiev
2006-03-31 19:15           ` Stephen Smalley
2006-03-31 19:18             ` Joshua Brindle
2006-03-31 19:32               ` Stephen Smalley
2006-04-02 17:55                 ` Joshua Brindle
2006-04-02 20:13                   ` Ivan Gyurdiev
2006-04-02 20:31                     ` Joshua Brindle
2006-03-31 22:17               ` Ivan Gyurdiev

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=442D47ED.6040007@tresys.com \
    --to=jbrindle@tresys.com \
    --cc=dwalsh@redhat.com \
    --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.