]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Feb 2024 12:30:20 +0000 (13:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Feb 2024 12:30:20 +0000 (13:30 +0100)
added patches:
pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch

queue-5.10/pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch b/queue-5.10/pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch
new file mode 100644 (file)
index 0000000..f7ffb92
--- /dev/null
@@ -0,0 +1,52 @@
+From b5d1b4b46f856da1473c7ba9a5cdfcb55c9b2478 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Fri, 26 Jan 2024 11:40:37 +0300
+Subject: PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit b5d1b4b46f856da1473c7ba9a5cdfcb55c9b2478 upstream.
+
+The "msg_addr" variable is u64.  However, the "aligned_offset" is an
+unsigned int.  This means that when the code does:
+
+  msg_addr &= ~aligned_offset;
+
+it will unintentionally zero out the high 32 bits.  Use ALIGN_DOWN() to do
+the alignment instead.
+
+Fixes: 2217fffcd63f ("PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support")
+Link: https://lore.kernel.org/r/af59c7ad-ab93-40f7-ad4a-7ac0b14d37f5@moroto.mountain
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Niklas Cassel <cassel@kernel.org>
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pci/controller/dwc/pcie-designware-ep.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
++++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
+@@ -6,6 +6,7 @@
+  * Author: Kishon Vijay Abraham I <kishon@ti.com>
+  */
++#include <linux/align.h>
+ #include <linux/of.h>
+ #include "pcie-designware.h"
+@@ -593,7 +594,7 @@ int dw_pcie_ep_raise_msix_irq(struct dw_
+       }
+       aligned_offset = msg_addr & (epc->mem->window.page_size - 1);
+-      msg_addr &= ~aligned_offset;
++      msg_addr = ALIGN_DOWN(msg_addr, epc->mem->window.page_size);
+       ret = dw_pcie_ep_map_addr(epc, func_no, ep->msi_mem_phys,  msg_addr,
+                                 epc->mem->window.page_size);
+       if (ret)
index 7931558976ffb1cf33b28c1f441f559ba71bee40..0490d9e779f3140a7d90ed9f8bbc2c8f21706779 100644 (file)
@@ -377,3 +377,4 @@ pm-runtime-have-devm_pm_runtime_enable-handle-pm_runtime_dont_use_autosuspend.pa
 drm-msm-dsi-enable-runtime-pm.patch
 netfilter-nf_tables-fix-pointer-math-issue-in-nft_byteorder_eval.patch
 net-bcmgenet-fix-eee-implementation.patch
+pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch