Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deny_set_scheduler #450

Merged
merged 4 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/ffi/deny_set_scheduler/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
summary: Test the sched_setscheduler() syscall inside QM is not allowed
test: /bin/bash ./test.sh
duration: 10m
tag: ffi
framework: shell
id: 9100f240-b4e8-4d73-87fe-c607ed1d89b2
25 changes: 25 additions & 0 deletions tests/ffi/deny_set_scheduler/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -euvx

. ../common/prepare.sh

local expected_result
pengshanyu marked this conversation as resolved.
Show resolved Hide resolved
expected_result="Failed to set scheduler: Operation not permitted"

disk_cleanup
prepare_test
reload_config

podman exec -it qm /bin/bash -c \
pengshanyu marked this conversation as resolved.
Show resolved Hide resolved
'podman run -d --replace --name ffi-qm \
quay.io/centos-sig-automotive/ffi-tools:latest \
tail -f /dev/null'

return_from_setscheduler=$(podman exec -it qm /bin/bash -c \
'podman exec -it ffi-qm ./QM/test_sched_setscheduler')

if [[ "${return_from_setscheduler}" =~ ${expected_result} ]]; then
info_message "set_scheduler() syscall denied in QM."
else
info_message "set_scheduler() syscall can be executed in QM."
exit 1
fi
Loading