]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs
authorNicholas Piggin <npiggin@gmail.com>
Fri, 23 Mar 2018 05:53:38 +0000 (15:53 +1000)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 9 Apr 2018 13:41:53 +0000 (10:41 -0300)
commitada7507dae7bef33e86a1017c8c2510b56f8a5c2
tree8999b8cfeccabf5083200f79ce1209e84bf8c3d9
parentc1a51e49133feafe6a4e4046e47b39ac02b0ac39
powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs

BugLink: http://bugs.launchpad.net/bugs/1762370
commit 52396500f97c53860164debc7d4f759077853423 upstream.

The SLB bad address handler's trap number fixup does not preserve the
low bit that indicates nonvolatile GPRs have not been saved. This
leads save_nvgprs to skip saving them, and subsequent functions and
return from interrupt will think they are saved.

This causes kernel branch-to-garbage debugging to not have correct
registers, can also cause userspace to have its registers clobbered
after a segfault.

Fixes: f0f558b131db ("powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address")
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
arch/powerpc/kernel/exceptions-64s.S