Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 642482

Summary: <sys-apps/kexec-tools-2.0.15 build_mem_phdrs() was not checking whether a p_paddr is invalid while kernel is providing invalid PT_LOAD entries
Product: Gentoo Linux Reporter: Xiami <i>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: critical CC: pastas4
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Kernel patch
Patch for kexec-tools-2.0.14

Description Xiami 2017-12-28 09:06:12 UTC
Created attachment 511806 [details, diff]
Kernel patch

I'm running the latest stablized kexec-tools (2.0.14) and when loading crash dump core it cries out:

    ELF core (kcore) parse failed

After digging into it, I found build_mem_phdrs check physical addr wrap arounds and some segments in /proc/kcore show a physical addr of 0xFFFFFFFFFFFFFFFF.

Kernel's commit log shows it starts assigning invalid PT_LOAD physical address as -1 since Feb 27, 2017.

The first released kernel containing this code is 4.11 .
The first released kexec-tools containing a fix is 2.0.15 .

Also, a patch is found for kexec-tools-2.0.14 source rpms.

Since we had >=sys-kernel/gentoo-sources-4.11 stablized, I recommend stablizing one of >=sys-apps/kexec-tools-2.0.15 .
Comment 1 Xiami 2017-12-28 09:06:43 UTC
Created attachment 511808 [details, diff]
Patch for kexec-tools-2.0.14
Comment 2 Dainius Masiliƫnas 2018-01-04 09:30:19 UTC
Indeed, this was also noticed in Ubuntu (https://bugs.launchpad.net/ubuntu/+source/kexec-tools/+bug/1713940) and Debian (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876042). It would be best to stabilise 2.0.15 or later.
Comment 3 Xiami 2023-02-08 09:33:30 UTC
Closing. =sys-apps/kexec-tools-2.0.14 is removed long long ago.