public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: policycoreutils/modules: Use filesystem_type instead of fs_t
Date: Fri, 11 Sep 2026 13:17:28 GMT	[thread overview]
Message-ID: <178913264823.1.9093524270630434535.tests-selinux-8c7670c1e669@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 8c7670c1e66953de82781cce9be812716e02c1b2
            Author : Petr Lautrbach <plautrba@redhat.com>
            Date   : 2019-03-12T13:37:06+01:00
            Stats  : +6/-6 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/8c7670c1e66953de82781cce9be812716e02c1b2?branch=pr775-checkpolicy-revdeps

            Log:
            policycoreutils/modules: Use filesystem_type instead of fs_t

Sometime, /tmp can be tmpfs_t so we need to allow test_t to be associated to all
filesystem types.

Fixes:
:: [ 08:16:37 ] :: [  BEGIN   ] :: Running 'chcon -t test_t test_file'
chcon: failed to change context of 'test_file' to ‘unconfined_u:object_r:test_t:s0’: Permission denied
:: [ 08:16:37 ] :: [   FAIL   ] :: Command 'chcon -t test_t test_file' (Expected 0, got 1)

type=AVC msg=audit(1552392203.833:2467): avc:  denied  { associate } for  pid=571 comm="chcon" name="test_file" dev="tmpfs" ino=77668 scontext=unconfined_u:object_r:test_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=filesystem permissive=0

---
diff --git a/policycoreutils/modules/runtest.sh b/policycoreutils/modules/runtest.sh
index 369f282..280c831 100755
--- a/policycoreutils/modules/runtest.sh
+++ b/policycoreutils/modules/runtest.sh
@@ -47,14 +47,14 @@ module test_module 1.0;
 
 require {
     type unconfined_t;
-    type fs_t;
+    attribute filesystem_type;
     class file { getattr ioctl lock open read relabelto write };
     class filesystem { associate };
 }
 
 type test_t;
 
-allow test_t fs_t:filesystem { associate };
+allow test_t filesystem_type:filesystem { associate };
 allow unconfined_t test_t:file { getattr ioctl lock open read relabelto};
 dontaudit unconfined_t test_t:file { write };
 EOF"
@@ -84,7 +84,7 @@ EOF"
         # create new type, allow reading, do not allow writing
         rlRun "cat << EOF >test_module.cil
 (type test_t)
-(allow test_t fs_t (filesystem (associate)))
+(allow test_t filesystem_type (filesystem (associate)))
 (allow unconfined_t test_t (file (getattr ioctl lock open read relabelto)))
 (dontaudit unconfined_t test_t (file (write)))
 EOF"
@@ -112,7 +112,7 @@ EOF"
         # create new type, allow reading and writing
         rlRun "cat << EOF >test_module.cil
 (type test_t)
-(allow test_t fs_t (filesystem (associate)))
+(allow test_t filesystem_type (filesystem (associate)))
 (allow unconfined_t test_t (file (getattr ioctl lock open read relabelto
     write)))
 EOF"
@@ -129,7 +129,7 @@ EOF"
         # create new type, allow only reading
         rlRun "cat << EOF >test_module.cil
 (type test_t)
-(allow test_t fs_t (filesystem (associate)))
+(allow test_t filesystem_type (filesystem (associate)))
 (allow unconfined_t test_t (file (getattr ioctl lock open read relabelto)))
 (dontaudit unconfined_t test_t (file (write)))
 EOF"
@@ -156,7 +156,7 @@ EOF"
         # create new type, allow reading
         rlRun "cat << EOF >test_module.cil
 (type test_t)
-(allow test_t fs_t (filesystem (associate)))
+(allow test_t filesystem_type (filesystem (associate)))
 (allow unconfined_t test_t (file (getattr ioctl lock open read relabelto)))
 (dontaudit unconfined_t test_t (file (write)))
 EOF"

                 reply	other threads:[~2026-09-11 13:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178913264823.1.9093524270630434535.tests-selinux-8c7670c1e669@fedoraproject.org \
    --to=plautrba@redhat.com \
    --cc=git-commits@fedoraproject.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