All of lore.kernel.org
 help / color / mirror / Atom feed
From: guido@trentalancia.com (Guido Trentalancia)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH/RFC 15/19]: patch set to update the git reference policy
Date: Mon, 31 Jan 2011 23:46:49 +0100	[thread overview]
Message-ID: <1296514009.18286.61.camel@tesla.lan> (raw)
In-Reply-To: <4D470FB3.3080507@tresys.com>

On Mon, 31/01/2011 at 14.38 -0500, Christopher J. PeBenito wrote:
> On 1/24/2011 4:01 PM, Dominick Grift wrote:
> > On 01/24/2011 09:54 PM, Guido Trentalancia wrote:
> >> On Mon, 24/01/2011 at 14.57 +0100, Dominick Grift wrote:
> >>> On 01/24/2011 01:44 AM, Guido Trentalancia wrote:
> >>>> diff -pruN -x .git -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-18012011/policy/modules/system/selinuxutil.te refpolicy-git-18012011-new/policy/modules/system/selinuxutil.te
> >>>> --- refpolicy-git-18012011/policy/modules/system/selinuxutil.te	2011-01-17 19:36:10.814131755 +0100
> >>>> +++ refpolicy-git-18012011-new/policy/modules/system/selinuxutil.te	2011-01-23 04:14:02.662963912 +0100
> >>>> @@ -444,6 +444,7 @@ files_read_etc_files(semanage_t)
> >>>>   files_read_etc_runtime_files(semanage_t)
> >>>>   files_read_usr_files(semanage_t)
> >>>>   files_list_pids(semanage_t)
> >>>> +files_search_default(semanage_t)
> >>>
> >>> There should not be any default_t directories. Thus this shouldnt be
> >>> allowed.
> >>
> >> This stems from the fact that at some point I came to a state where
> >> while working from the terminal (as opposed to working from a graphical
> >> terminal), semanage had trouble dealing with some temporary local
> >> modules that I was working with for testing purposes (they were labelled
> >> default_t)...
> >>
> >> Of course it can be removed. So, in general default_t should never
> >> appear anywhere in the policy ? Just for curiosity, what is the reason
> >> behind that ? If it is allowed to carry out operations on usr and
> >> etc_runtime files, why shouldn't it allowed to carry out operations on
> >> default_t ?
> >
> > locations unknown to selinux are labelled default_t. So for example if
> > you create a dir named /test in the root of the filesystem. There is no
> > file context specification for it and thus selinux labels it default_t.
> >
> > Basically it signals some incompatibility in that sense because files
> > always need a label, and this should not happen.
> >
> > Why should refpolicy support a scenario that should never happen in the
> > first place? default_t is not like other types like usr_t or
> > etc_runtime_t. types like file_t, default_t, unlabeled_t all signal some
> > other issues. I think this is discussed in "Fedora SELinux user guide"
> > (you can find it with google, its a free document.
> 
> This is the right idea, but I want to clarify the labeling.
> 
> default_t: this means no entry in file_contexts matches this file, so it 
> falls back to default_t.
> 
> unlabeled_t: this means the object has an invalid context.  Typically 
> this happens if a type is removed from the policy while the system is 
> running.
> 
> file_t: this means a filesystem that supports extended attributes is 
> mounted for the first time on a SELinux system.  The default for the 
> files in this case is file_t.
> 
> In all of these cases, the security attributes of the object are unknown.

Yes. I knew already about unlabeled_t and default_t, but I didn't know
about the existence and meaning of file_t, as I thought it was going to
default to unlabeled_t in the case mentioned above.

So good to know (we never stop learning) and thanks for pointing that
out, Christopher !

Basically, what happened is that I had a local problem with semanage
configuration, that led to a mislabeled /root directory. Everything
sorted out now.

Regards,

Guido

      parent reply	other threads:[~2011-01-31 22:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24  0:44 [refpolicy] [PATCH/RFC 15/19]: patch set to update the git reference policy Guido Trentalancia
2011-01-24 13:57 ` Dominick Grift
2011-01-24 20:54   ` Guido Trentalancia
2011-01-24 21:01     ` Dominick Grift
     [not found]       ` <4D470FB3.3080507@tresys.com>
2011-01-31 22:46         ` Guido Trentalancia [this message]

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=1296514009.18286.61.camel@tesla.lan \
    --to=guido@trentalancia.com \
    --cc=refpolicy@oss.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.