Adjust a crash-7.1.8 patch for support of /proc/kcore as the live

memory source in Linux 4.8 and later x86_64 kernels configured with
CONFIG_RANDOMIZE_BASE, which randomizes the unity-mapping PAGE_OFFSET
value.  Since the problem only arises before the determination of the
randomized PAGE_OFFSET value, restrict the patch such that it only
takes effect during session initialization.
(anderson@redhat.com)
This commit is contained in:
Dave Anderson 2019-11-04 11:56:28 -05:00
parent 869f3b24fc
commit 6a466f8afb

View File

@ -4269,7 +4269,8 @@ read_proc_kcore(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
* If KASLR, the PAGE_OFFSET may be unknown early on, so try
* the (hopefully) mapped kernel address first.
*/
if ((pc->curcmd_flags & MEMTYPE_KVADDR) && (kvaddr != addr)) {
if (!(pc->flags & RUNTIME) &&
(pc->curcmd_flags & MEMTYPE_KVADDR) && (kvaddr != addr)) {
pc->curcmd_flags &= ~MEMTYPE_KVADDR;
for (i = 0; i < pkd->segments; i++) {
lp64 = pkd->load64 + i;