]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
parisc: Fix set_fixmap() on PA1.x CPUs
authorHelge Deller <deller@gmx.de>
Sun, 31 Oct 2021 20:58:12 +0000 (21:58 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:32:28 +0000 (07:32 +0100)
BugLink: https://bugs.launchpad.net/bugs/1951822
commit 6e866a462867b60841202e900f10936a0478608c upstream.

Fix a kernel crash which happens on PA1.x CPUs while initializing the
FTRACE/KPROBE breakpoints.  The PTE table entries for the fixmap area
were not created correctly.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: ccfbc68d41c2 ("parisc: add set_fixmap()/clear_fixmap()")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/parisc/mm/fixmap.c

index 24426a7e1a5e5a43191675435b5d92d0ee2842c3..cc15d737fda64b1db0cf883dfbe622a7b0d16ad3 100644 (file)
@@ -20,12 +20,9 @@ void notrace set_fixmap(enum fixed_addresses idx, phys_addr_t phys)
        pte_t *pte;
 
        if (pmd_none(*pmd))
-               pmd = pmd_alloc(NULL, pud, vaddr);
-
-       pte = pte_offset_kernel(pmd, vaddr);
-       if (pte_none(*pte))
                pte = pte_alloc_kernel(pmd, vaddr);
 
+       pte = pte_offset_kernel(pmd, vaddr);
        set_pte_at(&init_mm, vaddr, pte, __mk_pte(phys, PAGE_KERNEL_RWX));
        flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE);
 }