Skip to contentSkip to conversation

Patch "sched: Disallow sched_attr::sched_policy < 0" has been added to the 3.14-stable tree

DISCUSSION Dave Jones 2 participants 2 messages Jun 9, 2014 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dave Jones

author
#1 lore raw
Quoted 11 lines · On Mon, Jun 09, 2014 at 12:07:07PM -0700, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

sched: Disallow sched_attr::sched_policy < 0

to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

kernel/sched/core.c SYSCALL_DEFINE3(sched_setattr, pid_t, pi · line 3691

Quoted 9 lines
kernel/sched/core.c +3 -0
@@ -3683,6 +3683,9 @@ SYSCALL_DEFINE3(sched_setattr, pid_t, pi
 	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);

Greg,

Make sure you also grab b14ed2c273f8ab872ae4e6735fe5ab09cb14b8c3 to fix this commit.

Dave

maintainer
#2 lore raw
Quoted 24 lines · Dave Jones
Quoted 11 lines · On Mon, Jun 09, 2014 at 12:07:07PM -0700, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

sched: Disallow sched_attr::sched_policy < 0

to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

kernel/sched/core.c SYSCALL_DEFINE3(sched_setattr, pid_t, pi · line 3691

Quoted 9 lines
kernel/sched/core.c +3 -0
@@ -3683,6 +3683,9 @@ SYSCALL_DEFINE3(sched_setattr, pid_t, pi
 	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);

Greg,

Quoted 1 line

Make sure you also grab b14ed2c273f8ab872ae4e6735fe5ab09cb14b8c3 to fix this commit.

Ah, missed that one, thanks for pointing it out, now applied.

greg k-h