]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 17 Apr 2020 11:58:36 +0000 (11:58 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:41:59 +0000 (10:41 +0200)
BugLink: https://bugs.launchpad.net/bugs/1876361
commit feb8e960d780e170e992a70491eec9dd68f4dbf2 upstream.

CONFIG_PPC_KUAP_DEBUG is not selectable because it depends on PPC_32
which doesn't exists.

Fixing it leads to a deadlock due to a vital register getting
clobbered in _switch().

Change dependency to PPC32 and use r0 instead of r4 in _switch()

Fixes: e2fb9f544431 ("powerpc/32: Prepare for Kernel Userspace Access Protection")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/540242f7d4573f7cdf1b3bf46bb35f743b2cd68f.1587124651.git.christophe.leroy@c-s.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/powerpc/kernel/entry_32.S
arch/powerpc/platforms/Kconfig.cputype

index 13f699256258e15dbbb5fa983ece6bda8abd8639..f29bb176381f19ed27f5443ab0f4e7cf5dfb53d0 100644 (file)
@@ -705,7 +705,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPE)
        stw     r10,_CCR(r1)
        stw     r1,KSP(r3)      /* Set old stack pointer */
 
-       kuap_check r2, r4
+       kuap_check r2, r0
 #ifdef CONFIG_SMP
        /* We need a sync somewhere here to make sure that if the
         * previous task gets rescheduled on another CPU, it sees all
index fa98fa36a4c48fd2e985378749bee81b43667339..f0330ce498d1e1b0e0ba67d6f0442396bfa95b93 100644 (file)
@@ -389,7 +389,7 @@ config PPC_KUAP
 
 config PPC_KUAP_DEBUG
        bool "Extra debugging for Kernel Userspace Access Protection"
-       depends on PPC_KUAP && (PPC_RADIX_MMU || PPC_32)
+       depends on PPC_KUAP && (PPC_RADIX_MMU || PPC32)
        help
          Add extra debugging for Kernel Userspace Access Protection (KUAP)
          If you're unsure, say N.