2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-15 16:53:54 +08:00
linux-next/arch/s390
Heiko Carstens f44e07a8af s390/crashdump: fix TOD programmable field size
The size of the TOD programmable field was incorrectly increased from
four to eight bytes with commit 1a2c5840ac ("s390/dump: cleanup CPU
save area handling").
This leads to an elf notes section NT_S390_TODPREG which has a size of
eight instead of four bytes in case of kdump, however even worse is
that the contents is incorrect: it is supposed to contain only the
contents of the TOD programmable field, but in fact contains a mix of
the TOD programmable field (32 bit upper bits) and parts of the CPU
timer register (lower 32 bits).

Fix this by simply changing the size of the todpreg field within the
save area structure. This will implicitly also fix the size of the
corresponding elf notes sections.

This also gets rid of this compile time warning:

in function ‘fortify_memcpy_chk’,
    inlined from ‘save_area_add_regs’ at arch/s390/kernel/crash_dump.c:99:2:
./include/linux/fortify-string.h:413:25: error: call to ‘__read_overflow2_field’
   declared with attribute warning: detected read beyond size of field
   (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning]
  413 |                         __read_overflow2_field(q_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 1a2c5840ac ("s390/dump: cleanup CPU save area handling")
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
2022-11-24 13:45:05 +01:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390: always build relocatable kernel 2022-11-08 19:32:32 +01:00
configs s390/configs: add kasan.config addon config file 2022-11-08 19:32:32 +01:00
crypto crypto: Kconfig - simplify cipher entries 2022-08-26 18:50:43 +08:00
hypfs s390/hypfs: avoid error message under KVM 2022-08-15 17:19:51 +02:00
include s390: avoid using global register for current_stack_pointer 2022-11-16 11:39:12 +01:00
kernel s390/crashdump: fix TOD programmable field size 2022-11-24 13:45:05 +01:00
kvm The first batch of KVM patches, mostly covering x86, which I 2022-10-09 09:39:55 -07:00
lib s390/uaccess: add missing EX_TABLE entries to __clear_user() 2022-10-26 14:47:30 +02:00
mm treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
net s390/bpf: Fix typo in comment 2022-05-23 11:25:53 -07:00
pci s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser() 2022-10-26 14:47:31 +02:00
purgatory s390/purgatory: remove duplicated build rule of kexec-purgatory.o 2022-06-30 14:18:16 +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: always build relocatable kernel 2022-11-08 19:32:32 +01:00