selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Haines <richard_c_haines@btinternet.com>
To: Stephen Smalley <sds@tycho.nsa.gov>, selinux@vger.kernel.org
Subject: Re: [PATCH 1/1] selinux-testsuite: Add perf_event tests
Date: Tue, 03 Dec 2019 16:00:31 +0000	[thread overview]
Message-ID: <048b2ebe62b56bb3497eec0cb99f9e13a91c29d9.camel@btinternet.com> (raw)
In-Reply-To: <a715e047-7973-2847-96c4-5f26cd29adb2@tycho.nsa.gov>

On Tue, 2019-12-03 at 10:15 -0500, Stephen Smalley wrote:
> On 12/1/19 9:52 AM, Richard Haines wrote:
> > Test perf_event permissions.
> > 
> > Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> > ---
> > diff --git a/policy/test_perf_event.te b/policy/test_perf_event.te
> > new file mode 100644
> > index 0000000..8b612bc
> > --- /dev/null
> > +++ b/policy/test_perf_event.te
> <snip>
> > +neverallow test_perf_no_admin_t self:capability { sys_admin };
> 
> I don't particularly object to this, but I wanted to note that these 
> neverallows are not being checked by default (expand-check=0 in 
> /etc/selinux/semanage.conf) and in fact, if one were to enable 
> expand-check, it would not be possible to insert the test policy
> module 
> without triggering some neverallow and/or typebounds failures
> because 
> the test policy intentionally violates such invariants at points.
> 
> Even the base Fedora policy doesn't appear to pass neverallow
> checking 
> at present; if you enable expand-check=1 in
> /etc/selinux/semanage.conf 
> and semodule -B, it fails (at least for me).
> 
> So your neverallow rules in the test policy are at best
> documentation.

Yes I was just using them as comments as the policy Makefile just stops
if expand-check=1.

I'll comment them out as I need to send a new version. I found that if
I set /proc/sys/kernel/perf_event_paranoid to < 2 then the 'Deny
capability { sys_admin }' test fails. I therefore now test the value
and bypass that test if < 2




      reply	other threads:[~2019-12-03 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-01 14:52 [PATCH 0/1] selinux-testsuite: Add perf_event tests Richard Haines
2019-12-01 14:52 ` [PATCH 1/1] " Richard Haines
2019-12-03 15:15   ` Stephen Smalley
2019-12-03 16:00     ` Richard Haines [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=048b2ebe62b56bb3497eec0cb99f9e13a91c29d9.camel@btinternet.com \
    --to=richard_c_haines@btinternet.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).