linux_dsm_epyc7002/arch/powerpc
Naveen N. Rao 5e5e63bacb powerpc/kprobes: Fix validation of prefixed instructions across page boundary
commit 82123a3d1d5a306fdf50c968a474cc60fe43a80f upstream.

When checking if the probed instruction is the suffix of a prefixed
instruction, we access the instruction at the previous word. If the
probed instruction is the very first word of a module, we can end up
trying to access an invalid page.

Fix this by skipping the check for all instructions at the beginning of
a page. Prefixed instructions cannot cross a 64-byte boundary and as
such, we don't expect to encounter a suffix as the very first word in a
page for kernel text. Even if there are prefixed instructions crossing
a page boundary (from a module, for instance), the instruction will be
illegal, so preventing probing on the suffix of such prefix instructions
isn't worthwhile.

Fixes: b4657f7650 ("powerpc/kprobes: Don't allow breakpoints on suffixes")
Cc: stable@vger.kernel.org # v5.8+
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/0df9a032a05576a2fa8e97d1b769af2ff0eafbd6.1621416666.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-10 13:39:27 +02:00
..
boot
configs
crypto
include powerpc/64s/syscall: Fix ptrace syscall info with scv syscalls 2021-05-26 12:06:53 +02:00
kernel powerpc/kprobes: Fix validation of prefixed instructions across page boundary 2021-06-10 13:39:27 +02:00
kexec powerpc/kexec_file: Use current CPU info while setting up FDT 2021-05-11 14:47:35 +02:00
kvm KVM: PPC: Book3S HV P9: Restore host CTRL SPR after guest exit 2021-05-14 09:50:35 +02:00
lib powerpc/64s: Fix crashes when toggling entry flush barrier 2021-05-19 10:13:10 +02:00
math-emu
mm powerpc/mm: Add cond_resched() while removing hpte mappings 2021-05-19 10:12:56 +02:00
net
oprofile
perf powerpc/perf: Fix the threshold event selection for memory events in power10 2021-05-14 09:50:42 +02:00
platforms powerpc/pseries: Fix hcall tracing recursion in pv queued spinlocks 2021-05-26 12:06:49 +02:00
purgatory
sysdev powerpc/xive: Fix xmon command "dxi" 2021-05-14 09:50:38 +02:00
tools
xmon
Kbuild
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-14 09:50:31 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:50:34 +02:00
Makefile
Makefile.postlink