From: Joshua Brindle <jbrindle@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Ivan Gyurdiev <ivg2@cornell.edu>,
SELinux List <SELinux@tycho.nsa.gov>,
selinuxdev <selinux-dev@tresys.com>
Subject: Re: [PATCH] libsemanage/semanage - permission check for semanage
Date: Mon, 23 Jan 2006 09:51:38 -0500 [thread overview]
Message-ID: <43D4ED7A.3090805@tresys.com> (raw)
In-Reply-To: <1138026975.20815.62.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Fri, 2006-01-20 at 16:25 -0500, Joshua Brindle wrote:
>
>>Stephen Smalley wrote:
>>
>>>Better, but a few lingering issues/questions:
>>>1) Running semanage as a non-root user with existing default modes on
>>>the policy module tree yields "SELinux policy is not managed."
>>>So we aren't quite providing the right information to the user yet.
>>>
>>
>>if the user can't stat the module directory how do we know whether or
>>not it is a managed system?
>
>
> Understood, but the message to the user needs to convey that fact, i.e.
> instead of just saying "SELinux policy is not managed", we likely need
> to say "SELinux policy is not managed or the module store is not
> accessible to you."
sounds good
>
> We also need to make sure that setsebool continues to do the right thing
> here, as it uses semanage_is_managed() to decide whether it should a)
> abort with an error (if < 0), b) fall back to the libselinux support for
> setting booleans (== 0), or proceed to use the semanage functions for
> setting booleans (> 0). It looks like this patch is fine in that
> respect since it doesn't change that interface; it should just silence
> the warning we get from libsemanage in (b).
>
yes, looking at setsebool it seems correct wrt is_managed. Which warning
are you speaking of? In is_managed == 0 it uses
selinux_set_boolean_list() and on success goes to out which destroys the
handle and returns.
> Trying setsebool as a normal user I get "Could not change active
> booleans: Permission denied", which seems like a reasonable error
> message for that case. Only potential concern is that what is really
> happening there is that setsebool is falling back to case (b) and trying
> to directly manipulate booleans via libselinux, and it is only the lack
> of permission to do so that prevents it from proceeding. So if the
> caller lacked permission to access the module store but had permission
> to directly manipulate booleans (a pathological situation indeed), then
> setsebool could do the wrong thing here.
>
Hrm.. an interesting problem. How can we determine when the fallback
should happen? It seems difficult to differenciate the 'not managed' and
'no permission to see store' cases, which means setsebool can't know
when to fallback and when not to. I'm not sure there is a solution to
this problem except to encapsulate access to booleans through
libsemanage clients, even in the targeted policy, which might not be
acceptable.
--
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.
next prev parent reply other threads:[~2006-01-23 14:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-19 21:45 [PATCH] libsemanage/semanage - permission check for semanage Joshua Brindle
2006-01-19 22:45 ` Ivan Gyurdiev
2006-01-20 1:38 ` Joshua Brindle
2006-01-20 2:11 ` Ivan Gyurdiev
2006-01-20 2:19 ` Joshua Brindle
2006-01-20 13:54 ` Stephen Smalley
2006-01-20 14:00 ` Joshua Brindle
2006-01-20 14:24 ` Stephen Smalley
2006-01-20 14:09 ` Stephen Smalley
2006-01-20 14:04 ` Joshua Brindle
2006-01-20 15:20 ` Stephen Smalley
2006-01-20 19:14 ` Joshua Brindle
2006-01-20 20:49 ` Stephen Smalley
2006-01-20 21:25 ` Joshua Brindle
2006-01-23 14:36 ` Stephen Smalley
2006-01-23 14:51 ` Joshua Brindle [this message]
2006-01-23 15:29 ` Stephen Smalley
2006-01-23 15:40 ` Joshua Brindle
2006-01-23 15:59 ` Stephen Smalley
2006-01-23 16:05 ` Joshua Brindle
2006-01-23 16:18 ` Stephen Smalley
2006-01-26 20:40 ` Joshua Brindle
2006-01-27 15:12 ` Stephen Smalley
2006-01-27 15:17 ` Joshua Brindle
2006-01-23 16:33 ` Joshua Brindle
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=43D4ED7A.3090805@tresys.com \
--to=jbrindle@tresys.com \
--cc=SELinux@tycho.nsa.gov \
--cc=ivg2@cornell.edu \
--cc=sds@tycho.nsa.gov \
--cc=selinux-dev@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.