All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Paul Moore <paul@paul-moore.com>,
	Daniel J Walsh <dwalsh@redhat.com>,
	Laurent Bigonville <bigon@debian.org>,
	SELinux List <selinux@tycho.nsa.gov>
Subject: Re: avc_has_perm() returns -1 even when SELinux is in permissive mode
Date: Mon, 28 Oct 2013 15:41:15 -0400	[thread overview]
Message-ID: <1382989275.3265.26.camel@localhost> (raw)
In-Reply-To: <526EB7A8.6040409@tycho.nsa.gov>

On Mon, 2013-10-28 at 15:14 -0400, Stephen Smalley wrote:

> I think we just need the userspace AVC to handle it cleanly and we'll be
> fine.   I think my patch will work, but don't have a test case offhand;

Hard for me to test on Fedora with the return 0;

setenforce 0
touch /etc/systemd/system/hello.service
chcon -t invalid_t /etc/systemd/system/hello.service
semanage permissive -a init_t  (needed so init itself can read the file)

setenforce 1
systemctl status hello.service
This shouldn't be silent, but it seems like it is, I'd have expected an
USER_AVC between my user type and the unlabeled_t...

setenforce 0
systemctl status hello.service
On Fedora this works, on others, it'll likely fail with EINVAL, (since
init will have CAP_MAC_ADMIN in permissive.)  init will be able to read
invalid_t (in enforcing it'll see unlabeled_t) and should pass that down
in the security check and get rejected/need and audit message...

-Eric


--
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.

  parent reply	other threads:[~2013-10-28 19:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-27 13:43 avc_has_perm() returns -1 even when SELinux is in permissive mode Laurent Bigonville
2013-10-28 12:49 ` Stephen Smalley
2013-10-28 13:36   ` Laurent Bigonville
2013-10-28 14:46     ` Daniel J Walsh
2013-10-28 15:56       ` Eric Paris
2013-10-28 16:58         ` Stephen Smalley
2013-10-28 17:11           ` Eric Paris
2013-10-28 17:21             ` Stephen Smalley
2013-10-28 18:15               ` Paul Moore
2013-10-28 18:10           ` Paul Moore
2013-10-28 18:24             ` Daniel J Walsh
2013-10-28 19:00               ` Stephen Smalley
2013-10-28 19:09                 ` Stephen Smalley
2013-10-28 19:26                   ` Stephen Smalley
2013-10-28 19:47                     ` Paul Moore
2013-10-28 19:03               ` Paul Moore
2013-10-28 19:14                 ` Stephen Smalley
2013-10-28 19:19                   ` Paul Moore
2013-10-28 19:41                   ` Eric Paris [this message]
2013-10-28 20:47                     ` Stephen Smalley
2013-10-28 12:55 ` Daniel J Walsh

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=1382989275.3265.26.camel@localhost \
    --to=eparis@redhat.com \
    --cc=bigon@debian.org \
    --cc=dwalsh@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --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.