All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Hannu Savolainen <hannu.savolainen@huawei.com>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>
Subject: Re: security_bounded_transition fails
Date: Fri, 18 Dec 2015 08:39:08 -0500	[thread overview]
Message-ID: <56740C7C.8060001@tycho.nsa.gov> (raw)
In-Reply-To: <B295455A1EDEE541907F53334176EF68070002FE@lhreml504-mbx>

On 12/18/2015 01:12 AM, Hannu Savolainen wrote:
> Hi,
>
> I'm having a problem with a multithreaded application. It does lengthy  initialization in advance under relatively privileged context and then switches to a less privileged one after the moment when the actual request arrives. After that it will create a chrooted container and join all threads to a new SELinux context.
>
> However the transition fails with audit message "op=security_bounded_transition result=denied oldcontext=old_context newcontext=new_context".
>
> Is there any policy rule that could be used to fix this or is this just not supported?

First, it is easier and safer to perform the privileged initialization 
and switch to the unprivileged context _before_ spawning other threads. 
  Then you won't have this problem at all.

If for some reason you cannot do that, then the requirement for a 
multi-threaded process is that you can only setcon to a domain bounded 
by your current domain, where these bounding relationships are defined 
through the use of the typebounds statement in policy.  The 
child/bounded domain is then restricted to a subset of the permissions 
of the parent/boundary domain, so you cannot allow the child/bounded 
domain any permission not allowed to the parent/boundary domain.

      parent reply	other threads:[~2015-12-18 13:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18  6:12 security_bounded_transition fails Hannu Savolainen
2015-12-18  8:46 ` Dominick Grift
2015-12-18 10:20   ` Dominick Grift
2015-12-18 10:45     ` Dominick Grift
     [not found]       ` <B295455A1EDEE541907F53334176EF68070003D0@lhreml504-mbx>
2015-12-18 15:05         ` Dominick Grift
2015-12-18 18:53           ` Stephen Smalley
2015-12-18 13:39 ` Stephen Smalley [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=56740C7C.8060001@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=hannu.savolainen@huawei.com \
    --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.