Accepting request 588595 from Kernel:kdump
OBS-URL: https://build.opensuse.org/request/show/588595 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/makedumpfile?expand=0&rev=66
This commit is contained in:
commit
cf9e0bee46
71
makedumpfile-sadump-fix-PTI-enabled-kernels.patch
Normal file
71
makedumpfile-sadump-fix-PTI-enabled-kernels.patch
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
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)
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 19 13:16:58 UTC 2018 - ptesarik@suse.com
|
||||||
|
|
||||||
|
- makedumpfile-sadump-fix-PTI-enabled-kernels.patch: sadump: Fix a
|
||||||
|
problem of PTI enabled kernel (bsc#1085826).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 29 14:01:03 UTC 2018 - ptesarik@suse.com
|
Mon Jan 29 14:01:03 UTC 2018 - ptesarik@suse.com
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ Source99: %{name}-rpmlintrc
|
|||||||
Patch0: %{name}-coptflags.diff
|
Patch0: %{name}-coptflags.diff
|
||||||
Patch1: %{name}-override-libtinfo.patch
|
Patch1: %{name}-override-libtinfo.patch
|
||||||
Patch2: %{name}-always-use-bigger-SECTION_MAP_MASK.patch
|
Patch2: %{name}-always-use-bigger-SECTION_MAP_MASK.patch
|
||||||
|
Patch3: %{name}-sadump-fix-PTI-enabled-kernels.patch
|
||||||
BuildRequires: libdw-devel
|
BuildRequires: libdw-devel
|
||||||
BuildRequires: libebl-devel
|
BuildRequires: libebl-devel
|
||||||
BuildRequires: libelf-devel
|
BuildRequires: libelf-devel
|
||||||
@ -70,6 +71,7 @@ via gdb or crash utility.
|
|||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{have_snappy}
|
%if %{have_snappy}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user