Files
linux/kernel
Qais Yousef cb0a2cdd48 UPSTREAM: sched/uclamp: Reject negative values in cpu_uclamp_write()
The check to ensure that the new written value into cpu.uclamp.{min,max}
is within range, [0:100], wasn't working because of the signed
comparison

 7301                 if (req.percent > UCLAMP_PERCENT_SCALE) {
 7302                         req.ret = -ERANGE;
 7303                         return req;
 7304                 }

	# echo -1 > cpu.uclamp.min
	# cat cpu.uclamp.min
	42949671.96

Cast req.percent into u64 to force the comparison to be unsigned and
work as intended in capacity_from_percent().

	# echo -1 > cpu.uclamp.min
	sh: write error: Numerical result out of range

Bug: 120440300
Fixes: 2480c09313 ("sched/uclamp: Extend CPU's cgroup controller")
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200114210947.14083-1-qais.yousef@arm.com
(cherry picked from commit b562d14064)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I17fc2b119dcbffb212e130ed2c37ae3a8d5bbb61
2020-03-03 11:41:08 +00:00
..
2020-03-03 07:33:01 +01:00
2020-02-05 19:20:26 +00:00
2020-01-27 15:55:44 +01:00
2020-02-11 15:05:03 -08:00
2019-05-17 16:05:09 -07:00
2020-01-09 16:14:43 +01:00
2020-02-11 15:05:03 -08:00
2020-02-24 09:13:25 +01:00
2019-12-13 08:51:11 +01:00
2019-05-31 06:46:17 -07:00
2019-12-01 09:17:17 +01:00
2020-02-24 09:13:25 +01:00
2020-01-27 15:55:44 +01:00
2019-12-01 09:17:38 +01:00
2020-01-15 14:51:23 +00:00
2019-12-01 09:53:43 +01:00
2020-02-24 09:13:25 +01:00
2019-08-12 13:36:37 -04:00
2020-01-27 15:55:44 +01:00
2018-07-03 09:20:44 +02:00
2020-01-09 10:18:59 +01:00
2018-06-07 16:56:28 -04:00
2019-03-06 15:59:21 +00:00