sched: Disallow sched_attr::sched_policy < 0
authorPeter Zijlstra <peterz@infradead.org>
Fri, 9 May 2014 08:49:03 +0000 (10:49 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 22 May 2014 08:21:26 +0000 (10:21 +0200)
commitdbdb22754fde671dc93d2fae06f8be113d47f2fb
tree150c824b8fb435ca64f034c740804e7a7da2297b
parent143cf23df25b7082cd706c3c53188e741e7881c3
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.

Reported-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: <stable@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140509085311.GJ30445@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c