All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: Eric Paris <eparis@redhat.com>
Cc: Eric Paris <eparis@parisplace.org>,
	Steve Lawrence <slawrence@tresys.com>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>,
	"qingtao.cao@windriver.com" <qingtao.cao@windriver.com>,
	"dwalsh@redhat.com" <dwalsh@redhat.com>,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH] libsepol: support policy modules when roletrans rules not supported
Date: Thu, 14 Apr 2011 11:00:31 -0400	[thread overview]
Message-ID: <4DA70C0F.10606@manicmethod.com> (raw)
In-Reply-To: <1302790741.9684.15.camel@unknown001a4b0c2895>

Eric Paris wrote:
> On Thu, 2011-04-14 at 09:58 -0400, Joshua Brindle wrote:
>> Eric Paris wrote:
>>> So I'm questioning the correctness of the range_transition and
>>> role_transition rules in libsepol.  My main problem is that libsepol
>>> defines SECCLASS_* at all.  Right now if the policy reads in one of
>>> these rules types without a tclass it will set SECCLASS_PROCESS in the
>>> tclasses bitmap.  But we never had any that would declare what the
>>> means.  At link time when we have to map "process" in a module to
>>> "process" in the base policy.  But if the module didn't require
>>> "process" it won't have the mapping.  So the fact that we set the
>>> SECCLASS_PROCESS bit could cause it to get mapped to random crap (or
>>> nothing at all)  Right?
>>>
>>> I know it's ugly but I think we need to do a couple of things.  #1 on
>>> that list is get SECCLASS_* out of libsepol altogether.  Those are
>>> COMPLETELY a construct of policy.  Not libsepol.  After we remove all
>>> of those we need to change the logic of everything that uses them to
>>> instead make sure that the "process" class exists in it's definitions
>>> and if not declare it.  Then set the bitmap for that new object.
>>>
>>> Am I not understanding something about how using SECCLASS_PROCESS
>>> could ever be a good idea?
>> It isn't the first time we've had hardcoded symbols that have to be mapped in
>> the code. See OBJECT_R_VAL as an example.
>>
>> It is a bit wonky though, suppose a type_transition rule were in a XenSE policy,
>> I don't think they have a process object class.
>
> So what it sounds like is that I probably want to look up the "process"
> class every time I would have used SECCLASS_PROCESS and if I don't find
> it, create it, and then look it up.  In this manor a policy which
> doesn't have process at all wouldn't have it forcibly jammed upon it
> (like we do in roles_init for OBJECT_R_VAL) and we wouldn't be mapping
> rules to garbage.  Sound right/ok to others?
>

It isn't the most elegant but there is precedence. I'm fine with it.

--
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:[~2011-04-14 15:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 21:11 [PATCH] libsepol: support policy modules when roletrans rules not supported Eric Paris
2011-04-13  9:12 ` Harry Ciao
2011-04-13 15:23 ` Steve Lawrence
2011-04-13 17:35   ` Steve Lawrence
2011-04-13 18:07     ` Eric Paris
2011-04-14 12:20       ` Steve Lawrence
2011-04-14 12:55         ` Now that we have an updated libsepol lets get the checkpolicy patch to match in Daniel J Walsh
2011-04-14 19:24           ` Steve Lawrence
2011-05-02 18:55           ` Steve Lawrence
2011-04-14 13:55       ` [PATCH] libsepol: support policy modules when roletrans rules not supported Eric Paris
2011-04-14 13:58         ` Joshua Brindle
2011-04-14 14:19           ` Eric Paris
2011-04-14 15:00             ` Joshua Brindle [this message]
2011-04-14 13:58         ` Stephen Smalley
2011-04-14 14:06           ` Eric Paris

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=4DA70C0F.10606@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=dwalsh@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=eparis@redhat.com \
    --cc=qingtao.cao@windriver.com \
    --cc=sds@tycho.nsa.gov \
    --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.