diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f5c6635b806..dbe44b5c02f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3683,6 +3683,9 @@ SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr, if (sched_copy_attr(uattr, &attr)) return -EFAULT; + if (attr.sched_policy < 0) + return -EINVAL; + rcu_read_lock(); retval = -ESRCH; p = find_process_by_pid(pid); |