Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.0:Rings:1-MinimalX
makedumpfile
makedumpfile-sadump-fix-PTI-enabled-kernels.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File makedumpfile-sadump-fix-PTI-enabled-kernels.patch of Package makedumpfile
From: Takao Indoh <indou.takao@jp.fujitsu.com> Date: Fri, 26 Jan 2018 09:22:26 +0900 Subject: sadump: Fix a problem of PTI enabled kernel References: bsc#1085826 Upstream: submitted Message-ID: <1516926146-20347-1-git-send-email-indou.takao@jp.fujitsu.com> This patch fixes a problme that a dumpfile of sadump cannot be handled by makedumpfile when Page Table Isolation(PTI) is enabled. When PTI is enabled, bit 12 of CR3 register is used to split user space and kernel space. Also bit 11:0 is used for Process Context IDentifiers(PCID). To open a dump file of sadump, a value of CR3 is used to calculate KASLR offset and phys_base, therefore this patch fixes to mask CR3 register value collectly for PTI enabled kernel. Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com> Acked-by: Petr Tesarik <ptesarik@suse.com> --- makedumpfile.c | 2 ++ makedumpfile.h | 2 ++ sadump_info.c | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) --- a/makedumpfile.c +++ b/makedumpfile.c @@ -1572,6 +1572,8 @@ get_symbol_info(void) SYMBOL_INIT(divide_error, "divide_error"); SYMBOL_INIT(idt_table, "idt_table"); SYMBOL_INIT(saved_command_line, "saved_command_line"); + SYMBOL_INIT(pti_init, "pti_init"); + SYMBOL_INIT(kaiser_init, "kaiser_init"); return TRUE; } --- a/makedumpfile.h +++ b/makedumpfile.h @@ -1606,6 +1606,8 @@ struct symbol_table { unsigned long long divide_error; unsigned long long idt_table; unsigned long long saved_command_line; + unsigned long long pti_init; + unsigned long long kaiser_init; /* * symbols on ppc64 arch --- a/sadump_info.c +++ b/sadump_info.c @@ -1362,6 +1362,9 @@ finish: * kernel. Retrieve vmcoreinfo from address of "elfcorehdr=" and * get kaslr_offset and phys_base from vmcoreinfo. */ +#define PTI_USER_PGTABLE_BIT (info->page_shift) +#define PTI_USER_PGTABLE_MASK (1 << PTI_USER_PGTABLE_BIT) +#define CR3_PCID_MASK 0xFFFull int calc_kaslr_offset(void) { @@ -1389,7 +1392,11 @@ calc_kaslr_offset(void) } idtr = ((uint64_t)smram.IdtUpper)<<32 | (uint64_t)smram.IdtLower; - cr3 = smram.Cr3; + if ((SYMBOL(pti_init) != NOT_FOUND_SYMBOL) || + (SYMBOL(kaiser_init) != NOT_FOUND_SYMBOL)) + cr3 = smram.Cr3 & ~(CR3_PCID_MASK|PTI_USER_PGTABLE_MASK); + else + cr3 = smram.Cr3 & ~CR3_PCID_MASK; /* Convert virtual address of IDT table to physical address */ if ((idtr_paddr = vtop4_x86_64_pagetable(idtr, cr3)) == NOT_PADDR)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor