History

sched: Disallow sched_attr::sched_policy < 0

The scheduler uses policy=-1 to preserve the current policy state to implement sys_sched_setparam(), this got exposed to userspace by accident through sys_sched_setattr(), cure this.

Peter Zijlstra committed 12 years ago

Commit dbdb2271 parent 143cf231 file · +3 −0Browse files

Unified · Split

kernel/sched/core.c+3−0
@@ -3662,6 +3662,9 @@ SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr, · 3661 unmodified lines
36623662 if (retval)
36633663 return retval;
36643664
3665+ if (attr.sched_policy < 0)
3666+ return -EINVAL;
3667+
36653668 rcu_read_lock();
36663669 retval = -ESRCH;
36673670 p = find_process_by_pid(pid);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t