Mel Gorman
703066188f
sched/fair: Null terminate buffer when updating tunable_scaling
...
This patch null-terminates the temporary buffer in sched_scaling_write()
so kstrtouint() does not return failure and checks the value is valid.
Before:
$ cat /sys/kernel/debug/sched/tunable_scaling
1
$ echo 0 > /sys/kernel/debug/sched/tunable_scaling
-bash: echo: write error: Invalid argument
$ cat /sys/kernel/debug/sched/tunable_scaling
1
After:
$ cat /sys/kernel/debug/sched/tunable_scaling
1
$ echo 0 > /sys/kernel/debug/sched/tunable_scaling
$ cat /sys/kernel/debug/sched/tunable_scaling
0
$ echo 3 > /sys/kernel/debug/sched/tunable_scaling
-bash: echo: write error: Invalid argument
Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs")
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20210927114635.GH3959@techsingularity.net
2021-10-01 13:57:57 +02:00
..
2019-06-24 19:23:40 +02:00
2021-03-22 00:11:52 +01:00
2020-03-23 18:40:25 +01:00
2021-05-12 11:43:31 +02:00
2021-09-12 11:37:41 -07:00
2021-05-12 11:43:26 +02:00
2020-11-10 18:39:00 +01:00
2021-08-06 15:34:55 +02:00
2019-12-12 17:59:43 +01:00
2021-03-22 00:11:52 +01:00
2020-10-29 11:00:30 +01:00
2021-04-28 13:33:57 -07:00
2021-08-06 14:25:24 +02:00
2021-10-01 13:57:57 +02:00
2021-10-01 13:57:57 +02:00
2021-04-21 13:55:41 +02:00
2021-09-09 10:36:16 +02:00
2021-05-13 14:12:47 +02:00
2021-05-12 21:34:17 +02:00
2021-05-12 11:43:31 +02:00
2021-03-06 12:40:21 +01:00
2021-03-22 00:11:52 +01:00
2021-06-18 11:31:25 +02:00
2021-07-01 17:22:14 -07:00
2021-06-22 16:41:59 +02:00
2019-06-17 12:15:58 +02:00
2021-08-30 13:42:10 -07:00
2020-05-28 11:03:20 +02:00
2021-03-22 00:11:52 +01:00
2021-06-18 11:43:07 +02:00
2021-05-12 11:43:28 +02:00
2020-03-21 16:00:23 +01:00
2021-08-20 12:32:57 +02:00
2019-12-17 13:32:50 +01:00
2021-06-08 15:12:57 -06:00