Gerald Schaefer a9f2f6865d s390/kaslr: store KASLR offset for early dumps
The KASLR offset is added to vmcoreinfo in arch_crash_save_vmcoreinfo(),
so that it can be found by crash when processing kernel dumps.

However, arch_crash_save_vmcoreinfo() is called during a subsys_initcall,
so if the kernel crashes before that, we have no vmcoreinfo and no KASLR
offset.

Fix this by storing the KASLR offset in the lowcore, where the vmcore_info
pointer will be stored, and where it can be found by crash. In order to
make it distinguishable from a real vmcore_info pointer, mark it as uneven
(KASLR offset itself is aligned to THREAD_SIZE).

When arch_crash_save_vmcoreinfo() stores the real vmcore_info pointer in
the lowcore, it overwrites the KASLR offset. At that point, the KASLR
offset is not yet added to vmcoreinfo, so we also need to move the
mem_assign_absolute() behind the vmcoreinfo_append_str().

Fixes: b2d24b97b2a9 ("s390/kernel: add support for kernel address space layout randomization (KASLR)")
Cc: <stable@vger.kernel.org> # v5.2+
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2019-11-30 10:52:45 +01:00
..
2019-07-23 10:45:53 +02:00
2019-11-30 10:52:44 +01:00
2019-11-30 10:52:44 +01:00
2012-05-16 14:42:41 +02:00
2019-11-30 10:52:44 +01:00
2019-04-29 10:47:10 +02:00
2019-06-07 10:09:37 +02:00
2019-05-02 13:54:11 +02:00
2019-04-29 10:47:10 +02:00
2019-05-02 13:54:11 +02:00
2019-04-23 21:51:40 +02:00
2018-02-27 08:05:23 +01:00
2019-06-07 10:09:37 +02:00
2019-10-31 17:20:52 +01:00
2019-09-17 14:04:43 -07:00