-
由 Odin Ugedal 提交于
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: NOdin Ugedal <odin@uged.al> Reviewed-by: NSuren Baghdasaryan <surenb@google.com> Acked-by: NDan Schatzberg <dschatzberg@fb.com> Fixes: df5ba5be ("kernel/sched/psi.c: expose pressure metrics on root cgroup") Acked-by: NJohannes Weiner <hannes@cmpxchg.org> Cc: stable@vger.kernel.org # 5.2+ Signed-off-by: NTejun Heo <tj@kernel.org>
385aac15