@@ -11,6 +11,7 @@ type test_setsched_target_t;
domain_type(test_setsched_target_t)
unconfined_runs_test(test_setsched_target_t)
corecmd_shell_entry_type(test_setsched_target_t)
+corecmd_exec_bin(test_setsched_target_t)
typeattribute test_setsched_target_t test_setsched_d;
typeattribute test_setsched_target_t testdomain;
@@ -10,7 +10,7 @@ $basedir =~ s|(.*)/[^/]*|$1|;
system("mkfifo $basedir/flag");
if ( ( $pid = fork() ) == 0 ) {
exec
-"runcon -t test_setsched_target_t sh -c 'echo >$basedir/flag; while :; do :; done'";
+"runcon -t test_setsched_target_t sh -c 'echo >$basedir/flag; while :; do sleep 1; done'";
}
# Wait for it to start.
On some old kernels (e.g. RHEL-5) the setscheduler test hangs the system after commit 26a3b59d5f5a ("selinux-testsuite: fix potential races when starting bg programs"). The issue seems to be that the new 'target' program does a busy loop, whereas the old one did sleep() in a loop. Fix this by sleeping inside the loop as before. Note that the policy needs to be updated to allow running the sleep command from a test_setsched_target_t process. Fixes: 26a3b59d5f5a ("selinux-testsuite: fix potential races when starting bg programs") Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> --- policy/test_task_setsched.te | 1 + tests/task_setscheduler/test | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)