linux/arch/s390
Heiko Carstens 912652366f s390/vx: fix save/restore of fpu kernel context
[ Upstream commit e6b2dab418 ]

The KERNEL_FPR mask only contains a flag for the first eight vector
registers. However floating point registers overlay parts of the first
sixteen vector registers.

This could lead to vector register corruption if a kernel fpu context uses
any of the vector registers 8 to 15 and is interrupted or calls a
KERNEL_FPR context. If that context uses also vector registers 8 to 15,
their contents will be corrupted on return.

Luckily this is currently not a real bug, since the kernel has only one
KERNEL_FPR user with s390_adjust_jiffies() and it is only using floating
point registers 0 to 2.

Fix this by using the correct bits for KERNEL_FPR.

Fixes: 7f79695cc1 ("s390/fpu: improve kernel_fpu_[begin|end]")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-01-01 12:38:53 +00:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390/ipl: add missing intersection check to ipl_report handling 2023-03-22 13:33:56 +01:00
configs s390/configs: add kasan.config addon config file 2022-11-08 19:32:32 +01:00
crypto s390/paes: fix PKEY_TYPE_EP11_AES handling for secure keyblobs 2023-09-13 09:42:29 +02:00
hypfs s390/hypfs: avoid error message under KVM 2022-08-15 17:19:51 +02:00
include s390/vx: fix save/restore of fpu kernel context 2024-01-01 12:38:53 +00:00
kernel s390/ipl: add missing secure/has_secure file to ipl type 'unknown' 2023-09-13 09:43:03 +02:00
kvm KVM: s390: fix sthyi error handling 2023-08-11 12:08:11 +02:00
lib s390/uaccess: add missing earlyclobber annotations to __clear_user() 2023-04-06 12:10:55 +02:00
mm KVM: s390/mm: Properly reset no-dat 2023-12-13 18:39:29 +01:00
net s390/bpf: Add expoline to tail calls 2023-03-10 09:32:57 +01:00
pci s390/pci: fix iommu bitmap allocation 2023-10-25 12:03:15 +02:00
purgatory s390/purgatory: disable branch profiling 2023-06-28 11:12:38 +02:00
tools KVM: s390: Add facility 197 to the allow list 2022-07-13 15:25:25 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig s390: always build relocatable kernel 2022-11-08 19:32:32 +01:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390/decompressor: fix misaligned symbol build error 2023-07-23 13:49:43 +02:00