linux/arch/s390
Gerald Schaefer 7a5da02de8 locking/lockdep: check for freed initmem in static_obj()
The following warning occurred on s390:
WARNING: CPU: 0 PID: 804 at kernel/locking/lockdep.c:1025 lockdep_register_key+0x30/0x150

This is because the check in static_obj() assumes that all memory within
[_stext, _end] belongs to static objects, which at least for s390 isn't
true. The init section is also part of this range, and freeing it allows
the buddy allocator to allocate memory from it. We have virt == phys for
the kernel on s390, so that such allocations would then have addresses
within the range [_stext, _end].

To fix this, introduce arch_is_kernel_initmem_freed(), similar to
arch_is_kernel_text/data(), and add it to the checks in static_obj().
This will always return 0 on architectures that do not define
arch_is_kernel_initmem_freed. On s390, it will return 1 if initmem has
been freed and the address is in the range [__init_begin, __init_end].

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2019-04-29 10:47:10 +02:00
..
appldata sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD 2018-10-26 16:26:32 -07:00
boot s390/kernel: add support for kernel address space layout randomization (KASLR) 2019-04-29 10:47:10 +02:00
configs s390/kexec_file: Signature verification prototype 2019-04-29 10:44:01 +02:00
crypto s390/crypto: use TRNG for seeding/reseeding 2019-04-25 15:34:09 +02:00
hypfs s390/kernel: introduce .dma sections 2019-04-29 10:47:10 +02:00
include locking/lockdep: check for freed initmem in static_obj() 2019-04-29 10:47:10 +02:00
kernel s390/kernel: add support for kernel address space layout randomization (KASLR) 2019-04-29 10:47:10 +02:00
kvm s390/airq: recognize directed interrupts 2019-04-29 10:47:01 +02:00
lib s390/kasan: improve string/memory functions checks 2019-01-18 09:34:18 +01:00
mm locking/lockdep: check for freed initmem in static_obj() 2019-04-29 10:47:10 +02:00
net s390: Convert IS_ENABLED uses to __is_defined 2019-04-11 13:36:53 +02:00
numa treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci s390/pci: add parameter to disable usage of MIO instructions 2019-04-29 10:47:01 +02:00
purgatory s390/purgatory: Omit use of bin2c 2019-04-29 10:43:55 +02:00
scripts s390: make chkbss work with clang 2019-04-11 13:36:52 +02:00
tools kbuild: use assignment instead of define ... endef for filechk_* rules 2019-01-06 10:22:35 +09:00
defconfig s390/kexec_file: Signature verification prototype 2019-04-29 10:44:01 +02:00
Kbuild s390/kexec_file: Add purgatory 2018-04-16 09:10:22 +02:00
Kconfig s390/kernel: add support for kernel address space layout randomization (KASLR) 2019-04-29 10:47:10 +02:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile s390/kernel: build a relocatable kernel 2019-04-29 10:47:10 +02:00