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

Allow using BATCH/IDLE scheduler classes in QM #702

Open
alexlarsson opened this issue Jan 10, 2025 · 1 comment
Open

Allow using BATCH/IDLE scheduler classes in QM #702

alexlarsson opened this issue Jan 10, 2025 · 1 comment

Comments

@alexlarsson
Copy link
Collaborator

The current seccomp changes completely disallow calling sched_setscheduler, but we can safely allow calling it with policy==SCHED_OTHER/BATCH/IDLE, as really the only problem is the various real-time classes.

The profile argument is the second (id 1) and the values for the classes are OTHER=0, BATCH==3, IDLE==5, so the rule should look like:

{
	"names": [
		"sched_setscheduler"
	],
	"action": "SCMP_ACT_ERRNO",
	"args": [
		{
			"index": 1,
			"value": 0,
			"valueTwo": 0,
			"op": "SCMP_CMP_NE"
		},
		{
			"index": 1,
			"value": 3,
			"valueTwo": 0,
			"op": "SCMP_CMP_NE"
		},
		{
			"index": 1,
			"value": 5,
			"valueTwo": 0,
			"op": "SCMP_CMP_NE"
		}
	],
	"errnoRet": 1,
	"errno": "EPERM"
}
@alexlarsson
Copy link
Collaborator Author

Unfortunately we can't allow this with sched_setattr, because in that syscall the profile argument is not a separate syscall argument but is stored in the memory pointed to by the attr pointer argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant