]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Oct 2021 15:04:27 +0000 (17:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Oct 2021 15:04:27 +0000 (17:04 +0200)
added patches:
x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch

queue-4.19/series
queue-4.19/x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch [new file with mode: 0644]

index eaa0cddab1eaf2e607947a36bb16e4c3f7203e4b..6f5971735c9259f3be8f0bd50afbad58178588d3 100644 (file)
@@ -7,3 +7,4 @@ s390-fix-strrchr-implementation.patch
 btrfs-deal-with-errors-when-replaying-dir-entry-during-log-replay.patch
 btrfs-deal-with-errors-when-adding-inode-reference-during-log-replay.patch
 btrfs-check-for-error-when-looking-up-inode-during-dir-entry-replay.patch
+x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch
diff --git a/queue-4.19/x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch b/queue-4.19/x86-resctrl-free-the-ctrlval-arrays-when-domain_setup_mon_state-fails.patch
new file mode 100644 (file)
index 0000000..2a22940
--- /dev/null
@@ -0,0 +1,43 @@
+From 64e87d4bd3201bf8a4685083ee4daf5c0d001452 Mon Sep 17 00:00:00 2001
+From: James Morse <james.morse@arm.com>
+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 <james.morse@arm.com>
+
+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 <james.morse@arm.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Acked-by: Reinette Chatre <reinette.chatre@intel.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lkml.kernel.org/r/20210917165958.28313-1-james.morse@arm.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ arch/x86/kernel/cpu/intel_rdt.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/x86/kernel/cpu/intel_rdt.c
++++ b/arch/x86/kernel/cpu/intel_rdt.c
+@@ -563,6 +563,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;
+       }