Commit afb34093 authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Annotate scheduler system calls as taking user pointers.

parent 5ef73fa6
...@@ -1711,7 +1711,7 @@ static inline task_t *find_process_by_pid(pid_t pid) ...@@ -1711,7 +1711,7 @@ static inline task_t *find_process_by_pid(pid_t pid)
/* /*
* setscheduler - change the scheduling policy and/or RT priority of a thread. * setscheduler - change the scheduling policy and/or RT priority of a thread.
*/ */
static int setscheduler(pid_t pid, int policy, struct sched_param *param) static int setscheduler(pid_t pid, int policy, struct sched_param __user *param)
{ {
struct sched_param lp; struct sched_param lp;
int retval = -EINVAL; int retval = -EINVAL;
...@@ -1804,7 +1804,7 @@ static int setscheduler(pid_t pid, int policy, struct sched_param *param) ...@@ -1804,7 +1804,7 @@ static int setscheduler(pid_t pid, int policy, struct sched_param *param)
* @param: structure containing the new RT priority. * @param: structure containing the new RT priority.
*/ */
asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
struct sched_param *param) struct sched_param __user *param)
{ {
return setscheduler(pid, policy, param); return setscheduler(pid, policy, param);
} }
...@@ -1814,7 +1814,7 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, ...@@ -1814,7 +1814,7 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
* @pid: the pid in question. * @pid: the pid in question.
* @param: structure containing the new RT priority. * @param: structure containing the new RT priority.
*/ */
asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param *param) asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param)
{ {
return setscheduler(pid, -1, param); return setscheduler(pid, -1, param);
} }
...@@ -1850,7 +1850,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid) ...@@ -1850,7 +1850,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid)
* @pid: the pid in question. * @pid: the pid in question.
* @param: structure containing the RT priority. * @param: structure containing the RT priority.
*/ */
asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param) asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param __user *param)
{ {
struct sched_param lp; struct sched_param lp;
int retval = -EINVAL; int retval = -EINVAL;
...@@ -1892,7 +1892,7 @@ asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param) ...@@ -1892,7 +1892,7 @@ asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param)
* @user_mask_ptr: user-space pointer to the new cpu mask * @user_mask_ptr: user-space pointer to the new cpu mask
*/ */
asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
unsigned long *user_mask_ptr) unsigned long __user *user_mask_ptr)
{ {
unsigned long new_mask; unsigned long new_mask;
int retval; int retval;
...@@ -1944,7 +1944,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, ...@@ -1944,7 +1944,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
* @user_mask_ptr: user-space pointer to hold the current cpu mask * @user_mask_ptr: user-space pointer to hold the current cpu mask
*/ */
asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
unsigned long *user_mask_ptr) unsigned long __user *user_mask_ptr)
{ {
unsigned int real_len; unsigned int real_len;
unsigned long mask; unsigned long mask;
...@@ -2110,7 +2110,7 @@ asmlinkage long sys_sched_get_priority_min(int policy) ...@@ -2110,7 +2110,7 @@ asmlinkage long sys_sched_get_priority_min(int policy)
* this syscall writes the default timeslice value of a given process * this syscall writes the default timeslice value of a given process
* into the user-space timespec buffer. A value of '0' means infinity. * into the user-space timespec buffer. A value of '0' means infinity.
*/ */
asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec *interval) asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
{ {
int retval = -EINVAL; int retval = -EINVAL;
struct timespec t; struct timespec t;
...@@ -2343,7 +2343,8 @@ void set_cpus_allowed(task_t *p, unsigned long new_mask) ...@@ -2343,7 +2343,8 @@ void set_cpus_allowed(task_t *p, unsigned long new_mask)
*/ */
static int migration_thread(void * data) static int migration_thread(void * data)
{ {
struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; /* Marking "param" __user is ok, since we do a set_fs(KERNEL_DS); */
struct sched_param __user param = { .sched_priority = MAX_RT_PRIO-1 };
int cpu = (long) data; int cpu = (long) data;
runqueue_t *rq; runqueue_t *rq;
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment