linux/arch/s390
Heiko Carstens 5fefdceafb s390/crashdump: fix TOD programmable field size
[ Upstream commit f44e07a8af ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-02 17:41:07 +01:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390/boot: add secure boot trailer 2022-11-10 18:15:32 +01:00
configs s390: update defconfigs 2021-09-15 14:29:21 +02:00
crypto s390/archrandom: simplify back to earlier design and initialize earlier 2022-07-07 17:53:24 +02:00
hypfs s390/hypfs: avoid error message under KVM 2022-09-05 10:30:11 +02:00
include s390/futex: add missing EX_TABLE entry to __futex_atomic_op() 2022-11-03 23:59:13 +09:00
kernel s390/crashdump: fix TOD programmable field size 2022-12-02 17:41:07 +01:00
kvm KVM: s390: pv: don't allow userspace to set the clock under PV 2022-11-16 09:58:17 +01:00
lib s390/uaccess: add missing EX_TABLE entries to __clear_user() 2022-11-10 18:15:32 +01:00
mm s390/mm: do not trigger write fault when vma does not allow VM_WRITE 2022-08-31 17:16:48 +02:00
net bpf, s390: Fix potential memory leak about jit_data 2021-10-04 09:49:10 +02:00
pci s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser() 2022-11-03 23:59:13 +09:00
purgatory s390: enable KCSAN 2021-07-30 17:09:23 +02:00
tools s390/disassembler: add instructions 2021-07-27 09:39:19 +02:00
Kbuild s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
Kconfig s390: remove unneeded 'select BUILD_BIN2C' 2022-07-07 17:53:27 +02:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile s390: disable -Warray-bounds 2022-05-18 10:26:52 +02:00