Skip to content
Commit 385aac15 authored by Odin Ugedal's avatar Odin Ugedal Committed by Tejun Heo
Browse files

cgroup: fix psi monitor for root cgroup



Fix NULL pointer dereference when adding new psi monitor to the root
cgroup. PSI files for root cgroup was introduced in df5ba5be by using
system wide psi struct when reading, but file write/monitor was not
properly fixed. Since the PSI config for the root cgroup isn't
initialized, the current implementation tries to lock a NULL ptr,
resulting in a crash.

Can be triggered by running this as root:
$ tee /sys/fs/cgroup/cpu.pressure <<< "some 10000 1000000"

Signed-off-by: default avatarOdin Ugedal <odin@uged.al>
Reviewed-by: default avatarSuren Baghdasaryan <surenb@google.com>
Acked-by: default avatarDan Schatzberg <dschatzberg@fb.com>
Fixes: df5ba5be ("kernel/sched/psi.c: expose pressure metrics on root cgroup")
Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Cc: stable@vger.kernel.org # 5.2+
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent b5e56576
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment