linux-stable/arch
Helge Deller 760dc9f658 parisc: Fix exception handler for fldw and fstw instructions
commit 7ae1f5508d upstream.

The exception handler is broken for unaligned memory acceses with fldw
and fstw instructions, because it trashes or uses randomly some other
floating point register than the one specified in the instruction word
on loads and stores.

The instruction "fldw 0(addr),%fr22L" (and the other fldw/fstw
instructions) encode the target register (%fr22) in the rightmost 5 bits
of the instruction word. The 7th rightmost bit of the instruction word
defines if the left or right half of %fr22 should be used.

While processing unaligned address accesses, the FR3() define is used to
extract the offset into the local floating-point register set.  But the
calculation in FR3() was buggy, so that for example instead of %fr22,
register %fr12 [((22 * 2) & 0x1f) = 12] was used.

This bug has been since forever in the parisc kernel and I wonder why it
wasn't detected earlier. Interestingly I noticed this bug just because
the libime debian package failed to build on *native* hardware, while it
successfully built in qemu.

This patch corrects the bitshift and masking calculation in FR3().

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-31 17:17:59 +02:00
..
alpha
arc
arm ARM: Marvell: Update PCIe fixup 2022-08-17 15:16:09 +02:00
arm64 KVM: arm64: Reject 32bit user PSTATE on asymmetric systems 2022-08-25 11:45:38 +02:00
csky csky/kprobe: reclaim insn_slot on kprobe unregistration 2022-08-25 11:45:46 +02:00
hexagon
ia64 ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr() 2022-08-17 15:13:56 +02:00
loongarch LoongArch: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-08-17 15:13:46 +02:00
m68k m68k: coldfire/device.c: protect FLEXCAN blocks 2022-08-25 11:45:15 +02:00
microblaze
mips MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0 2022-08-25 11:45:53 +02:00
nios2 nios2: add force_successful_syscall_return() 2022-08-25 11:45:27 +02:00
openrisc openrisc: io: Define iounmap argument as volatile 2022-08-25 11:45:46 +02:00
parisc parisc: Fix exception handler for fldw and fstw instructions 2022-08-31 17:17:59 +02:00
powerpc powerpc/64: Init jump labels before parse_early_param() 2022-08-25 11:45:53 +02:00
riscv RISC-V: Add fast call path of crash_kexec() 2022-08-25 11:45:50 +02:00
s390 Revert "s390/smp: enforce lowcore protection on CPU restart" 2022-08-17 15:16:20 +02:00
sh
sparc mmu_gather: Remove per arch tlb_{start,end}_vma() 2022-07-21 10:50:13 -07:00
um um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups 2022-08-25 11:45:45 +02:00
x86 x86/kvm: Fix "missing ENDBR" BUG for fastop functions 2022-08-25 11:45:39 +02:00
xtensa xtensa: iss: fix handling error cases in iss_net_configure() 2022-08-17 15:15:32 +02:00
.gitignore
Kconfig arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-08-17 15:13:59 +02:00