Skip to content

Commit

Permalink
Merge pull request #455 from pengshanyu/add_deny_sched_setattr
Browse files Browse the repository at this point in the history
add deny_sched_setattr
  • Loading branch information
Yarboa authored Jun 17, 2024
2 parents 7cad7f8 + 8275fc7 commit 6a4c9fd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
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."
else
info_message "Failure: SCHED_DEADLINE can not be set via sched_setattr() syscall in QM."
exit 1
fi

0 comments on commit 6a4c9fd

Please sign in to comment.