mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Add a new priv 'PRIV_SCHED_CPUSET' to check if manipulating cpusets is
allowed and replace the suser() call. Do not allow it in jails. Reviewed by: rwatson
This commit is contained in:
parent
6b2bbb0465
commit
ba931c0855
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180098
@ -292,7 +292,7 @@ cpuset_modify(struct cpuset *set, cpuset_t *mask)
|
||||
struct cpuset *root;
|
||||
int error;
|
||||
|
||||
error = suser(curthread);
|
||||
error = priv_check(curthread, PRIV_SCHED_CPUSET);
|
||||
if (error)
|
||||
return (error);
|
||||
/*
|
||||
|
@ -187,6 +187,7 @@
|
||||
#define PRIV_SCHED_SETPOLICY 203 /* Can set scheduler policy. */
|
||||
#define PRIV_SCHED_SET 204 /* Can set thread scheduler. */
|
||||
#define PRIV_SCHED_SETPARAM 205 /* Can set thread scheduler params. */
|
||||
#define PRIV_SCHED_CPUSET 206 /* Can manipulate cpusets. */
|
||||
|
||||
/*
|
||||
* POSIX semaphore privileges.
|
||||
|
Loading…
Reference in New Issue
Block a user