kernel_samsung_a53x/arch/arm64/kernel
Mark Rutland f2ddadb749 arm64: probes: Fix simulate_ldr*_literal()
commit 50f813e57601c22b6f26ced3193b9b94d70a2640 upstream.

The simulate_ldr_literal() code always loads a 64-bit quantity, and when
simulating a 32-bit load into a 'W' register, it discards the most
significant 32 bits. For big-endian kernels this means that the relevant
bits are discarded, and the value returned is the the subsequent 32 bits
in memory (i.e. the value at addr + 4).

Additionally, simulate_ldr_literal() and simulate_ldrsw_literal() use a
plain C load, which the compiler may tear or elide (e.g. if the target
is the zero register). Today this doesn't happen to matter, but it may
matter in future if trampoline code uses a LDR (literal) or LDRSW
(literal).

Update simulate_ldr_literal() and simulate_ldrsw_literal() to use an
appropriately-sized READ_ONCE() to perform the access, which avoids
these problems.

Fixes: 39a67d49ba35 ("arm64: kprobes instruction simulation support")
Cc: stable@vger.kernel.org
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241008155851.801546-3-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:21:54 +01:00
..
probes arm64: probes: Fix simulate_ldr*_literal() 2024-11-23 23:21:54 +01:00
vdso Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vdso32 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
acpi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
acpi_numa.c arm64: acpi: Move get_cpu_for_acpi_id() to a header 2024-11-23 23:21:08 +01:00
acpi_parking_protocol.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alternative.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
armv8_deprecated.c arm64: armv8_deprecated: fix unused-function error 2024-11-08 11:26:06 +01:00
asm-offsets.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cacheinfo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu-reset.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu-reset.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu_errata.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpufeature.c arm64: cpufeature: Fix the visibility of compat hwcaps 2024-11-23 23:20:31 +01:00
cpuidle.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpuinfo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crash_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crash_dump.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debug-monitors.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
efi-entry.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
efi-header.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
efi-rt-wrapper.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
efi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
entry-common.c arm64: allow kprobes on EL0 handlers 2024-11-08 11:26:02 +01:00
entry-fpsimd.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
entry-ftrace.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
entry.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fpsimd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ftrace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
head.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hibernate-asm.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hibernate.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hw_breakpoint.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hyp-stub.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
idreg-override.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
image-vars.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
image.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
insn.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
io.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jump_label.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kaslr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kexec_image.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kgdb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kuser32.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
machine_kexec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
machine_kexec_file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
module-plts.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
module.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mte.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
paravirt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf_callchain.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf_event.c drivers/perf: pmuv3: don't expose SW_INCR event in sysfs 2024-11-18 12:13:07 +01:00
perf_regs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pointer_auth.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
process.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
proton-pack.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ptrace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reloc_test_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reloc_test_syms.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
relocate_kernel.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
return_address.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdei.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
setup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
signal.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
signal32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sigreturn32.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sleep.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smccc-call.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smp_spin_table.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stacktrace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
suspend.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sys.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sys32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sys_compat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
syscall.c security: samsung: defex_lsm: nuke 2024-06-15 16:20:49 -03:00
time.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topology.c arch_topology: Rename freq_scale as arch_freq_scale 2024-11-17 17:45:22 +01:00
trace-events-emulation.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
traps.c arm64: allow kprobes on EL0 handlers 2024-11-08 11:26:02 +01:00
uh_entry.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vdso.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vmlinux.lds.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00