android_kernel_samsung_sm8650/arch
Heiko Carstens 7a4d6481fb s390/ptrace: handle setting of fpc register correctly
[ Upstream commit 8b13601d19c541158a6e18b278c00ba69ae37829 ]

If the content of the floating point control (fpc) register of a traced
process is modified with the ptrace interface the new value is tested for
validity by temporarily loading it into the fpc register.

This may lead to corruption of the fpc register of the tracing process:
if an interrupt happens while the value is temporarily loaded into the
fpc register, and within interrupt context floating point or vector
registers are used, the current fp/vx registers are saved with
save_fpu_regs() assuming they belong to user space and will be loaded into
fp/vx registers when returning to user space.

test_fp_ctl() restores the original user space fpc register value, however
it will be discarded, when returning to user space.

In result the tracer will incorrectly continue to run with the value that
was supposed to be used for the traced process.

Fix this by saving fpu register contents with save_fpu_regs() before using
test_fp_ctl().

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-05 20:12:49 +00:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:17:01 -08:00
arc ARC: fix spare error 2024-01-20 11:50:08 +01:00
arm arch: consolidate arch_irq_work_raise prototypes 2024-02-05 20:12:49 +00:00
arm64 arch: consolidate arch_irq_work_raise prototypes 2024-02-05 20:12:49 +00:00
csky arch: consolidate arch_irq_work_raise prototypes 2024-02-05 20:12:49 +00:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch LoongArch/smp: Call rcutree_report_cpu_starting() earlier 2024-01-31 16:17:03 -08:00
m68k m68k: Fix invalid .section syntax 2023-09-13 09:42:21 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
mips mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan 2024-01-31 16:17:12 -08:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
parisc parisc/firmware: Fix F-extend for PDC addresses 2024-01-31 16:16:59 -08:00
powerpc arch: consolidate arch_irq_work_raise prototypes 2024-02-05 20:12:49 +00:00
riscv arch: consolidate arch_irq_work_raise prototypes 2024-02-05 20:12:49 +00:00
s390 s390/ptrace: handle setting of fpc register correctly 2024-02-05 20:12:49 +00:00
sh sh: bios: Revive earlyprintk support 2023-11-20 11:52:07 +01:00
sparc sparc32: fix a braino in fault handling in csum_and_copy_..._user() 2023-11-02 09:35:32 +01:00
um um: Fix hostaudio build errors 2023-09-13 09:42:58 +02:00
x86 arch: consolidate arch_irq_work_raise prototypes 2024-02-05 20:12:49 +00:00
xtensa xtensa: boot/lib: fix function prototypes 2023-10-06 14:56:49 +02:00
.gitignore
Kconfig cpu/SMT: Create topology_smt_thread_allowed() 2024-01-10 17:10:26 +01:00