All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: selinux@tycho.nsa.gov
Cc: paul@paul-moore.com, toiwoton@gmail.com,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: [PATCH 1/2] selinux-testsuite: mmap: fix shmat SHM_EXEC test for old kernels
Date: Thu, 27 Oct 2016 14:28:44 -0400	[thread overview]
Message-ID: <1477592925-9693-1-git-send-email-sds@tycho.nsa.gov> (raw)

Older kernels checked read+write+execute to the backing tmpfs
file for shmat SHM_EXEC instead of execmem.  Adjust the test policy
to allow the tests to pass on these older kernels.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 policy/test_mmap.te | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/policy/test_mmap.te b/policy/test_mmap.te
index e039f76..8eed390 100644
--- a/policy/test_mmap.te
+++ b/policy/test_mmap.te
@@ -31,6 +31,8 @@ allow test_execmem_t self:process execmem;
 allow test_execmem_t test_mmap_file_t:file { open read execute };
 # For mmap_hugetlb_anon_shared test.
 allow test_execmem_t hugetlbfs_t:file { read write execute };
+# For shmat test on old kernels.
+allow test_execmem_t tmpfs_t:file { read write execute };
 
 type test_no_execmem_t;
 domain_type(test_no_execmem_t)
@@ -41,6 +43,8 @@ typeattribute test_no_execmem_t mmaptestdomain;
 allow test_no_execmem_t test_mmap_file_t:file { open read };
 # For mmap_hugetlb_anon_shared test.
 allow test_no_execmem_t hugetlbfs_t:file { read write };
+# For shmat test on old kernels: no execmem check, only tmpfs write+execute.
+allow test_no_execmem_t tmpfs_t:file { read write };
 
 type test_mprotect_anon_shared_t;
 domain_type(test_mprotect_anon_shared_t)
-- 
2.7.4

             reply	other threads:[~2016-10-27 18:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 18:28 Stephen Smalley [this message]
2016-10-27 18:28 ` [PATCH 2/2] selinux-testsuite: mmap: fix shmat SHM_EXEC test for old policies Stephen Smalley

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=1477592925-9693-1-git-send-email-sds@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=paul@paul-moore.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=toiwoton@gmail.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.