From: Greg Kroah-Hartman Date: Fri, 23 Feb 2024 15:41:44 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v4.19.308~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8cd2e60c290338bbe95e6a3447031c73e997c7f;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch --- diff --git a/queue-5.15/pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch b/queue-5.15/pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch new file mode 100644 index 00000000000..c463b5c78c0 --- /dev/null +++ b/queue-5.15/pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch @@ -0,0 +1,50 @@ +From cbc98e30eb470a924d2fd59ae693d5480b3d263d Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Fri, 26 Jan 2024 11:40:37 +0300 +Subject: PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq() + +From: Dan Carpenter + +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 +Signed-off-by: Bjorn Helgaas +Reviewed-by: Niklas Cassel +Reviewed-by: Ilpo Järvinen +Reviewed-by: Manivannan Sadhasivam +Cc: +Signed-off-by: Niklas Cassel +Signed-off-by: Greg Kroah-Hartman +--- + 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 + */ + ++#include + #include + #include + +@@ -589,7 +590,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, 0, ep->msi_mem_phys, msg_addr, + epc->mem->window.page_size); + if (ret) diff --git a/queue-5.15/series b/queue-5.15/series index 39d0d6259cc..114db49cc82 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -5,3 +5,4 @@ smb-client-fix-oob-in-receive_encrypted_standard.patch smb-client-fix-potential-oobs-in-smb2_parse_contexts.patch smb-client-fix-parsing-of-smb3.1.1-posix-create-context.patch sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch +pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch