From: Greg Kroah-Hartman Date: Sun, 17 Oct 2021 15:05:12 +0000 (+0200) Subject: 5.14-stable patches X-Git-Tag: v4.14.252~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02c806db1ede1757e3cc97108f378fc5a7c089a8;p=thirdparty%2Fkernel%2Fstable-queue.git 5.14-stable patches added patches: x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch --- diff --git a/queue-5.14/series b/queue-5.14/series index e93fb4af564..c52aec43eaf 100644 --- a/queue-5.14/series +++ b/queue-5.14/series @@ -34,3 +34,4 @@ btrfs-check-for-error-when-looking-up-inode-during-dir-entry-replay.patch btrfs-update-refs-for-any-root-except-tree-log-roots.patch btrfs-fix-abort-logic-in-btrfs_replace_file_extents.patch module-fix-clang-cfi-with-module_unload-n.patch +x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch diff --git a/queue-5.14/x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch b/queue-5.14/x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch new file mode 100644 index 00000000000..4347f6a7663 --- /dev/null +++ b/queue-5.14/x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch @@ -0,0 +1,41 @@ +From 64e87d4bd3201bf8a4685083ee4daf5c0d001452 Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Fri, 17 Sep 2021 16:59:58 +0000 +Subject: x86/resctrl: Free the ctrlval arrays when domain_setup_mon_state() fails + +From: James Morse + +commit 64e87d4bd3201bf8a4685083ee4daf5c0d001452 upstream. + +domain_add_cpu() is called whenever a CPU is brought online. The +earlier call to domain_setup_ctrlval() allocates the control value +arrays. + +If domain_setup_mon_state() fails, the control value arrays are not +freed. + +Add the missing kfree() calls. + +Fixes: 1bd2a63b4f0de ("x86/intel_rdt/mba_sc: Add initialization support") +Fixes: edf6fa1c4a951 ("x86/intel_rdt/cqm: Add RMID (Resource monitoring ID) management") +Signed-off-by: James Morse +Signed-off-by: Borislav Petkov +Acked-by: Reinette Chatre +Cc: +Link: https://lkml.kernel.org/r/20210917165958.28313-1-james.morse@arm.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/cpu/resctrl/core.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/kernel/cpu/resctrl/core.c ++++ b/arch/x86/kernel/cpu/resctrl/core.c +@@ -590,6 +590,8 @@ static void domain_add_cpu(int cpu, stru + } + + if (r->mon_capable && domain_setup_mon_state(r, d)) { ++ kfree(d->ctrl_val); ++ kfree(d->mbps_val); + kfree(d); + return; + }