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
53 stars 43 forks source link

BUG: Fix/restore broken NFS double mount test #92

Open stephensmalley opened 5 months ago

stephensmalley commented 5 months ago

tests/nfs_filesystem: remove failing mount For reasons unclear, we attempt to mount twice, the 2nd time yields EBUSY, and then the following test fails. Remove the 2nd mount, which also resolves the failure.

Output: Run NFS context specific tests nfs_filesystem/test .. 2/56 creat(2) Failed: Permission denied

Failed test at nfs_filesystem/test line 118.

nfs_filesystem/test .. 30/56 creat(2) Failed: Permission denied

Failed test at nfs_filesystem/test line 118.

nfs_filesystem/test .. 53/56 # Looks like you failed 2 tests of 56. nfs_filesystem/test .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/56 subtests

Test Summary Report

nfs_filesystem/test (Wstat: 512 (exited 2) Tests: 56 Failed: 2) Failed tests: 7, 35 Non-zero exit status: 2 Files=1, Tests=56, 12 wallclock secs ( 0.02 usr 0.00 sys + 0.15 cusr 0.25 csys = 0.42 CPU) Result: FAIL Failed 1/1 test programs. 2/56 subtests failed. Error on line: 104 - Closing down NFS umount: /mnt/selinux-testsuite: not mounted. NFS Closed down

stephensmalley commented 5 months ago

This appears to be a return of an older kernel bug described in the test script comments:

Mount a security_label exported NFS filesystem twice, confirm that

# NFS security labeling support isn't silently disabled by trying to
# set a label on a file and confirm it is set.
# Fixed by kernel commit 3815a245b50124f0865415dcb606a034e97494d4
# "security/selinux: fix SECURITY_LSM_NATIVE_LABELS on reused superblock"
#