linux-uconsole/arch/x86/kernel/cpu
Shakeel Butt bb8e8f427f x86/resctrl: Fix potential memory leak
commit ab6a211443 upstream.

set_cache_qos_cfg() is leaking memory when the given level is not
RDT_RESOURCE_L3 or RDT_RESOURCE_L2. At the moment, this function is
called with only valid levels but move the allocation after the valid
level checks in order to make it more robust and future proof.

 [ bp: Massage commit message. ]

Fixes: 99adde9b37 ("x86/intel_rdt: Enable L2 CDP in MSR IA32_L2_QOS_CFG")
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20200102165844.133133-1-shakeelb@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23 08:21:30 +01:00
..
mcheck x86/mce: Fix possibly incorrect severity calculation on AMD 2020-01-04 19:13:19 +01:00
microcode x86/microcode: Fix the microcode load on CPU hotplug for real 2019-07-03 13:14:45 +02:00
mtrr x86/mtrr: Don't copy uninitialized gentry fields back to userspace 2018-12-29 13:37:57 +01:00
.gitignore
amd.c x86/CPU/AMD: Ensure clearing of SME/SEV features is maintained 2020-01-23 08:21:30 +01:00
aperfmperf.c x86 / CPU: Always show current CPU frequency in /proc/cpuinfo 2017-11-15 19:46:50 +01:00
bugs.c x86/speculation: Fix redundant MDS mitigation message 2019-12-01 09:17:37 +01:00
cacheinfo.c x86/cacheinfo: Fix a -Wtype-limits warning 2019-07-26 09:14:09 +02:00
centaur.c x86/CPU: Move x86_cpuinfo::x86_max_cores assignment to detect_num_cpu_cores() 2018-05-13 16:14:24 +02:00
common.c x86/CPU: Change query logic so CPUID is enabled before testing 2019-11-20 18:47:14 +01:00
cpu.h x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default 2019-11-12 19:21:32 +01:00
cpuid-deps.c x86/cpufeatures: Combine word 11 and 12 into a new scattered features word 2019-08-06 19:06:58 +02:00
cyrix.c x86/CPU: Use correct macros for Cyrix calls 2019-11-20 18:47:14 +01:00
hypervisor.c x86/jailhouse: Add infrastructure for running in non-root cell 2018-01-14 21:11:54 +01:00
intel.c x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default 2019-11-12 19:21:32 +01:00
intel_pconfig.c x86/pconfig: Detect PCONFIG targets 2018-03-12 12:10:54 +01:00
intel_rdt.c x86/resctrl: Fix an imbalance in domain_remove_cpu() 2020-01-23 08:21:29 +01:00
intel_rdt.h x86/intel_rdt: Fix out-of-bounds memory access in CBM tests 2018-10-09 08:02:15 +02:00
intel_rdt_ctrlmondata.c x86/resctrl: Prevent NULL pointer dereference when reading mondata 2019-12-05 09:19:40 +01:00
intel_rdt_monitor.c x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled 2019-06-19 08:18:07 +02:00
intel_rdt_pseudo_lock.c x86/intel_rdt: Prevent pseudo-locking from using stale pointers 2019-12-01 09:16:43 +01:00
intel_rdt_pseudo_lock_event.h x86/intel_rdt: Support L3 cache performance event of Broadwell 2018-06-24 15:35:48 +02:00
intel_rdt_rdtgroup.c x86/resctrl: Fix potential memory leak 2020-01-23 08:21:30 +01:00
Makefile x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default 2019-11-12 19:21:32 +01:00
match.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mkcapflags.sh x86/build: Add 'set -e' to mkcapflags.sh to delete broken capflags.c 2019-07-26 09:14:11 +02:00
mshyperv.c x86/hyper-v: Enable PIT shutdown quirk 2018-11-21 09:19:20 +01:00
perfctr-watchdog.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
powerflags.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c x86/cpu: Change type of x86_cache_size variable to unsigned int 2018-02-15 01:15:53 +01:00
rdrand.c
scattered.c x86/cpufeatures: Combine word 11 and 12 into a new scattered features word 2019-08-06 19:06:58 +02:00
topology.c x86/cpu/topology: Provide detect_extended_topology_early() 2018-06-21 14:20:59 +02:00
transmeta.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tsx.c x86/tsx: Add config options to set tsx=on|off|auto 2019-11-12 19:21:35 +01:00
umc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmware.c x86/cpu/vmware: Do not trace vmware_sched_clock() 2018-11-21 09:19:19 +01:00