linux/kernel/sched
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: 8a99b6833c ("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
..
Makefile
autogroup.c
autogroup.h
clock.c
completion.c
core.c - Make sure the idle timer expires in hardirq context, on PREEMPT_RT 2021-09-12 11:37:41 -07:00
core_sched.c
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c
cpupri.c
cpupri.h
cputime.c
deadline.c
debug.c sched/fair: Null terminate buffer when updating tunable_scaling 2021-10-01 13:57:57 +02:00
fair.c sched/fair: Add ancestors of unthrottled undecayed cfs_rq 2021-10-01 13:57:57 +02:00
features.h
idle.c sched/idle: Make the idle timer expire in hard interrupt context 2021-09-09 10:36:16 +02:00
isolation.c
loadavg.c
membarrier.c
pelt.c
pelt.h
psi.c
rt.c
sched-pelt.h
sched.h Scheduler changes for v5.15 are: 2021-08-30 13:42:10 -07:00
smp.h
stats.c
stats.h
stop_task.c
swait.c
topology.c sched/topology: Skip updating masks for non-online nodes 2021-08-20 12:32:57 +02:00
wait.c
wait_bit.c