SELinuxProject / selinux-testsuite

This is the upstream SELinux testsuite which is designed as a basic set of regression tests for the SELinux kernel functionality.
GNU General Public License v2.0
54 stars 43 forks source link

SELinux policy and tests for posix mqueues #10

Closed davidgraz closed 7 years ago

davidgraz commented 7 years ago

This is a set of tests for use with the posix mqueue filesystem.

The policy defines three process types:

It also defines the following types:

They test the creation, labeling, access (read/write) and removal of queues. The manage domain is used to create three queues (mqread, mqwrite, mqrw). Within the policy a named type_transition is defined to uniquely label each of these queues. The other test domains then perform read and/or write operations on the queues and their success/failure is evaluated based on the policy.

Note: The test checks to see if mqueue named type_transitions are supported by the kernel. If not, after their creation chcon is used to apply the appropriate labels.

Signed-off-by: David Graziano david.graziano@rockwellcollins.com

stephensmalley commented 7 years ago

LGTM, will wait on @pcmoore to ack.

pcmoore commented 7 years ago

Sorry, I didn't forget about this, I just didn't get to this today, it's on my list for tomorrow/weekend.

pcmoore commented 7 years ago

This looks good to me, the only comment I have is a bit nit picky - why not just name the test directory "mqueue"? The SysV message queue tests are already present under "msg", the "posix_" prefix seems a bit unnecessary.

davidgraz commented 7 years ago

@pcmoore I will update the naming to drop the "posix"

pcmoore commented 7 years ago

Thanks @davidgraz, I appreciate the quick response (even if my responses aren't so quick these days).

pcmoore commented 7 years ago

@stephensmalley did we really want to merge this now without the corresponding kernel support?

stephensmalley commented 7 years ago

The test is written such that it will fall back to manual labeling of the mqueues if the kernel does not support it, and thus the tests pass on old and new kernels.