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_sched_setattr #455

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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_sched_setattr/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
summary: Test QM not allow SCHED_DEADLINE be set via sched_setattr() syscall
test: /bin/bash ./test.sh
duration: 10m
tag: ffi
framework: shell
id: 6e0d8dd9-2106-4f57-be1b-98f443145b36
24 changes: 24 additions & 0 deletions tests/ffi/deny_sched_setattr/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -euvx

. ../common/prepare.sh

export QM_HOST_REGISTRY_DIR="/var/qm/lib/containers/registry"
export QM_REGISTRY_DIR="/var/lib/containers/registry"
expected_result="sched_setattr failed: Operation not permitted"

disk_cleanup
prepare_test
reload_config

prepare_images
run_container_in_qm "ffi-qm"

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

if [[ "${return_from_sched_setattr}" =~ "${expected_result}" ]]; then
info_message "QM not allow SCHED_DEADLINE be set via sched_setattr() syscall."
pengshanyu marked this conversation as resolved.
Show resolved Hide resolved
else
info_message "Failure: SCHED_DEADLINE can not be set via sched_setattr() syscall in QM."
exit 1
fi
Loading