Skip to content

Commit 72e60b6

Browse files
pcmooreWOnder93
authored andcommitted
policy/test_secretmem.te: add anon_inode perms required in Linux v6.16-rc5
Starting with Linux v6.16-rc5 and commit cbe4134ea4bc ("fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass") secretmem's anonymous inodes are no longer marked as S_PRIVATE which means they are subject to a number of SELinux permission checks that has been previously skipped. This patch updates the test policy to account for these new checks and allows for a clean test run on Linux kernel builds with the above mentioned patch. It is worth noting that there are still some capability/ipc_lock AVC denials when running the secretmem tests, but granting access to CAP_IPC_LOCK proved not to be strictly necessary for a clean test run so those rules were omitted from this patch. Suggested-by: Shivank Garg <shivankg@amd.com> Signed-off-by: Paul Moore <paul@paul-moore.com> [OM: drop an unnecessary execute permission + added Suggested-by] Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
1 parent ee0ba4d commit 72e60b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

policy/test_secretmem.te

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ testsuite_domain_type_minimal(test_nocreate_secretmem_t)
1313
# Domain allowed to create secret memory with the own domain type
1414
type test_create_secretmem_t;
1515
testsuite_domain_type_minimal(test_create_secretmem_t)
16-
allow test_create_secretmem_t self:anon_inode create;
16+
allow test_create_secretmem_t self:anon_inode { create map read write };
1717

1818
# Domain allowed to create secret memory with the own domain type and allowed to map WX
1919
type test_create_wx_secretmem_t;
2020
testsuite_domain_type_minimal(test_create_wx_secretmem_t)
21-
allow test_create_wx_secretmem_t self:anon_inode create;
21+
allow test_create_wx_secretmem_t self:anon_inode { create map read write };
2222
allow test_create_wx_secretmem_t self:process execmem;
2323

2424
# Domain not allowed to create secret memory via a type transition to a private type
@@ -30,4 +30,4 @@ type_transition test_nocreate_transition_secretmem_t test_nocreate_transition_se
3030
type test_create_transition_secretmem_t;
3131
testsuite_domain_type_minimal(test_create_transition_secretmem_t)
3232
type_transition test_create_transition_secretmem_t test_create_transition_secretmem_t:anon_inode test_secretmem_inode_t "[secretmem]";
33-
allow test_create_transition_secretmem_t test_secretmem_inode_t:anon_inode create;
33+
allow test_create_transition_secretmem_t test_secretmem_inode_t:anon_inode { create map read write };

0 commit comments

Comments
 (0)