]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Jul 2025 14:34:09 +0000 (16:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Jul 2025 14:34:09 +0000 (16:34 +0200)
added patches:
arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch

queue-5.10/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch b/queue-5.10/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch
new file mode 100644 (file)
index 0000000..440cd02
--- /dev/null
@@ -0,0 +1,46 @@
+From 650768c512faba8070bf4cfbb28c95eb5cd203f3 Mon Sep 17 00:00:00 2001
+From: Dev Jain <dev.jain@arm.com>
+Date: Tue, 27 May 2025 13:56:33 +0530
+Subject: arm64: Restrict pagetable teardown to avoid false warning
+
+From: Dev Jain <dev.jain@arm.com>
+
+commit 650768c512faba8070bf4cfbb28c95eb5cd203f3 upstream.
+
+Commit 9c006972c3fe ("arm64: mmu: drop pXd_present() checks from
+pXd_free_pYd_table()") removes the pxd_present() checks because the
+caller checks pxd_present(). But, in case of vmap_try_huge_pud(), the
+caller only checks pud_present(); pud_free_pmd_page() recurses on each
+pmd through pmd_free_pte_page(), wherein the pmd may be none. Thus it is
+possible to hit a warning in the latter, since pmd_none => !pmd_table().
+Thus, add a pmd_present() check in pud_free_pmd_page().
+
+This problem was found by code inspection.
+
+Fixes: 9c006972c3fe ("arm64: mmu: drop pXd_present() checks from pXd_free_pYd_table()")
+Cc: stable@vger.kernel.org
+Reported-by: Ryan Roberts <ryan.roberts@arm.com>
+Acked-by: David Hildenbrand <david@redhat.com>
+Signed-off-by: Dev Jain <dev.jain@arm.com>
+Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
+Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
+Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
+Link: https://lore.kernel.org/r/20250527082633.61073-1-dev.jain@arm.com
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/mm/mmu.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm64/mm/mmu.c
++++ b/arch/arm64/mm/mmu.c
+@@ -1459,7 +1459,8 @@ int pud_free_pmd_page(pud_t *pudp, unsig
+       next = addr;
+       end = addr + PUD_SIZE;
+       do {
+-              pmd_free_pte_page(pmdp, next);
++              if (pmd_present(READ_ONCE(*pmdp)))
++                      pmd_free_pte_page(pmdp, next);
+       } while (pmdp++, next += PMD_SIZE, next != end);
+       pud_clear(pudp);
index 61d6145bda729716962b4dab66064fe4fffb7eed..f9c3f9fed447d95d6b2efcc006b23d9be71444e0 100644 (file)
@@ -77,3 +77,4 @@ drm-bridge-cdns-dsi-wait-for-clk-and-data-lanes-to-be-ready.patch
 pci-hv-do-not-set-pci_command_memory-to-reduce-vm-boot-time.patch
 s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch
 revert-ipv6-save-dontfrag-in-cork.patch
+arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch