All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Lawrence <slawrence@tresys.com>
To: Sven Vermeulen <sven.vermeulen@siphos.be>,
	SELinux <selinux@tycho.nsa.gov>
Subject: Re: Permission requirements for semodule?
Date: Mon, 24 Nov 2014 08:39:37 -0500	[thread overview]
Message-ID: <54733519.40706@tresys.com> (raw)
In-Reply-To: <CAPzO=Nx9u_mwAuiPDfpfTOt01t0JLKdgbDQ6-foTr2SZmWPo3g@mail.gmail.com>

On 11/22/2014 11:46 AM, Sven Vermeulen wrote:
> Hi all
> 
> I'm working with 2.4_rc6 (with the additional patch that Steve sent to
> the list on November 19th) and noticed that some of the utilities are
> trying to access the HLL files. Currently, our policy disallows that,
> but other than that I see no issues.
> 
> For instance, when loading a policy module (pp) using "semodule -i
> /path/to/module.pp":
> 
> type=AVC msg=audit(1416673390.476:215): avc:  denied  { read } for
> pid=2729 comm="load_policy"
> path="/var/lib/selinux/mcs/active/modules/400/selocal/hll" dev=
> "sdb2" ino=6573925 scontext=staff_u:sysadm_r:load_policy_t:s0
> tcontext=staff_u:object_r:semanage_var_lib_t:s0 tclass=file
> 
> type=AVC msg=audit(1416673390.505:217): avc:  denied  { read } for
> pid=2730 comm="setfiles"
> path="/var/lib/selinux/mcs/active/modules/400/selocal/hll" dev="sdb2"
> ino=6573925 scontext=staff_u:sysadm_r:setfiles_t:s0
> tcontext=staff_u:object_r:semanage_var_lib_t:s0 tclass=file
> 
> The module is loaded and the changes are active, so I'm inclined to
> dontaudit it. But I'd rather ask up front. What are the tools trying
> to do? And, is semanage_var_lib_t the right type for the HLL files? I
> would expect it to need to be semanage_store_t?
> 

Looks like there might be a couple of problems here.

1) As you expected, files in /var/lib/selinux should be labeled
semanage_store_t. But we don't have any filecontexts/policy for those.
The semanage_migrate_store script uses setfscreatecon to set the labels
correctly, but if you run restorecon/setfiles they're going to reset to
semanage_var_lib_t. We'll work on a refpolicy patch for that today.

2) I'm not entirely sure why load_policy and setfiles want the file:read
permission on hll files. Those programs should never be reading those
files. Perhaps semodule is leaking file descriptors or something.
Looking into it.

Thanks,
- Steve

      reply	other threads:[~2014-11-24 13:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22 16:46 Permission requirements for semodule? Sven Vermeulen
2014-11-24 13:39 ` Steve Lawrence [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=54733519.40706@tresys.com \
    --to=slawrence@tresys.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=sven.vermeulen@siphos.be \
    /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.