[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-b14ed2c273f8ab872ae4e6735fe5ab09cb14b8c3@git.kernel.org>
Date: Thu, 5 Jun 2014 07:33:38 -0700
From: tip-bot for Richard Weinberger <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
torvalds@...ux-foundation.org, peterz@...radead.org,
richard@....at, tglx@...utronix.de, mtk.manpages@...il.com
Subject: [tip:sched/urgent] sched: Fix sched_policy < 0 comparison
Commit-ID: b14ed2c273f8ab872ae4e6735fe5ab09cb14b8c3
Gitweb: http://git.kernel.org/tip/b14ed2c273f8ab872ae4e6735fe5ab09cb14b8c3
Author: Richard Weinberger <richard@....at>
AuthorDate: Mon, 2 Jun 2014 22:38:34 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 5 Jun 2014 11:07:43 +0200
sched: Fix sched_policy < 0 comparison
attr.sched_policy is u32, therefore a comparison against < 0 is never true.
Fix this by casting sched_policy to int.
This issue was reported by coverity CID 1219934.
Fixes: dbdb22754fde ("sched: Disallow sched_attr::sched_policy < 0")
Signed-off-by: Richard Weinberger <richard@....at>
Signed-off-by: Peter Zijlstra <peterz@...radead.org>
Cc: Michael Kerrisk <mtk.manpages@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: http://lkml.kernel.org/r/1401741514-7045-1-git-send-email-richard@nod.at
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 86f3890..540542b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3685,7 +3685,7 @@ SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
if (retval)
return retval;
- if (attr.sched_policy < 0)
+ if ((int)attr.sched_policy < 0)
return -EINVAL;
rcu_read_lock();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists