]> git.baikalelectronics.ru Git - kernel.git/commit
x86/intel_rdt: Prevent pseudo-locking from using stale pointers
authorJithu Joseph <jithu.joseph@intel.com>
Fri, 12 Oct 2018 22:51:01 +0000 (15:51 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 19 Oct 2018 12:54:28 +0000 (14:54 +0200)
commit609d35d13f43908bf28432c7015c23825ed1791f
tree08cd45e0ebebb2d96b0073ce1d858d695c075a44
parent4494a3eee96976477432cef77f1eb6edd1a088e0
x86/intel_rdt: Prevent pseudo-locking from using stale pointers

When the last CPU in an rdt_domain goes offline, its rdt_domain struct gets
freed. Current pseudo-locking code is unaware of this scenario and tries to
dereference the freed structure in a few places.

Add checks to prevent pseudo-locking code from doing this.

While further work is needed to seamlessly restore resource groups (not
just pseudo-locking) to their configuration when the domain is brought back
online, the immediate issue of invalid pointers is addressed here.

Fixes: 7980c13ff1d92 ("x86/intel_rdt: Resctrl files reflect pseudo-locked information")
Fixes: 539d8bab51116 ("x86/intel_rdt: Create debugfs files for pseudo-locking testing")
Fixes: 8833408cfd755 ("x86/intel_rdt: Create character device exposing pseudo-locked region")
Fixes: 2a3b1ab11f0b2 ("x86/intel_rdt: Make CPU information accessible for pseudo-locked regions")
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: fenghua.yu@intel.com
Cc: tony.luck@intel.com
Cc: gavin.hindman@intel.com
Cc: hpa@zytor.com
Link: https://lkml.kernel.org/r/231f742dbb7b00a31cc104416860e27dba6b072d.1539384145.git.reinette.chatre@intel.com
arch/x86/kernel/cpu/intel_rdt.c
arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c