]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Feb 2022 07:03:16 +0000 (08:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Feb 2022 07:03:16 +0000 (08:03 +0100)
added patches:
edac-fix-calculation-of-returned-address-and-next-offset-in-edac_align_ptr.patch

queue-4.14/edac-fix-calculation-of-returned-address-and-next-offset-in-edac_align_ptr.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/edac-fix-calculation-of-returned-address-and-next-offset-in-edac_align_ptr.patch b/queue-4.14/edac-fix-calculation-of-returned-address-and-next-offset-in-edac_align_ptr.patch
new file mode 100644 (file)
index 0000000..02e8389
--- /dev/null
@@ -0,0 +1,45 @@
+From f8efca92ae509c25e0a4bd5d0a86decea4f0c41e Mon Sep 17 00:00:00 2001
+From: Eliav Farber <farbere@amazon.com>
+Date: Thu, 13 Jan 2022 10:06:19 +0000
+Subject: EDAC: Fix calculation of returned address and next offset in edac_align_ptr()
+
+From: Eliav Farber <farbere@amazon.com>
+
+commit f8efca92ae509c25e0a4bd5d0a86decea4f0c41e upstream.
+
+Do alignment logic properly and use the "ptr" local variable for
+calculating the remainder of the alignment.
+
+This became an issue because struct edac_mc_layer has a size that is not
+zero modulo eight, and the next offset that was prepared for the private
+data was unaligned, causing an alignment exception.
+
+The patch in Fixes: which broke this actually wanted to "what we
+actually care about is the alignment of the actual pointer that's about
+to be returned." But it didn't check that alignment.
+
+Use the correct variable "ptr" for that.
+
+  [ bp: Massage commit message. ]
+
+Fixes: 8447c4d15e35 ("edac: Do alignment logic properly in edac_align_ptr()")
+Signed-off-by: Eliav Farber <farbere@amazon.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20220113100622.12783-2-farbere@amazon.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/edac/edac_mc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/edac/edac_mc.c
++++ b/drivers/edac/edac_mc.c
+@@ -264,7 +264,7 @@ void *edac_align_ptr(void **p, unsigned
+       else
+               return (char *)ptr;
+-      r = (unsigned long)p % align;
++      r = (unsigned long)ptr % align;
+       if (r == 0)
+               return (char *)ptr;
index 7f8305a473ade7d08478e65856f8156f6fe1e386..bec0b5fa9643fa48aad7cdcde18e651015358bb1 100644 (file)
@@ -30,6 +30,7 @@ asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch
 asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch
 powerpc-lib-sstep-fix-ptesync-build-error.patch
 nfs-lookup_directory-is-also-ok-with-symlinks.patch
+edac-fix-calculation-of-returned-address-and-next-offset-in-edac_align_ptr.patch
 mtd-rawnand-brcmnand-refactored-code-to-introduce-he.patch
 mtd-rawnand-brcmnand-fixed-incorrect-sub-page-ecc-st.patch
 kvm-x86-pmu-use-amd64_raw_event_mask-for-perf_type_r.patch