Accepting request 971036 from home:polslinux:branches:Kernel:kdump

- Update to 1.7.1:
  * support for kernel up to 5.17
  * sadump: remove variable length array
  * print error when reading with unsupported compression
- Drop upstreamed makedumpfile-sadump-kaslr-fix-kaslr_offset-calculation.patch

OBS-URL: https://build.opensuse.org/request/show/971036
OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/makedumpfile?expand=0&rev=164
This commit is contained in:
Petr Tesařík 2022-06-07 09:47:24 +00:00 committed by Git OBS Bridge
parent 0d9ecd57e6
commit fc54b30a87
8 changed files with 42 additions and 78 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8985f8df249087ea68c6051dec6dac3ef0703fe2aa87d0266f3951f93aa8da5e
size 202820

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb04b1bd0e750d0d0ac1b43b759b326d4a3797b0af08e0c269d1b155893fb664
size 204593

View File

@ -9,8 +9,10 @@ Signed-off-by: Petr Tesarik <ptesarik@suse.com>
elf_info.h | 4 ++++
1 file changed, 4 insertions(+)
--- a/elf_info.h
+++ b/elf_info.h
Index: makedumpfile-1.7.1/elf_info.h
===================================================================
--- makedumpfile-1.7.1.orig/elf_info.h
+++ makedumpfile-1.7.1/elf_info.h
@@ -19,6 +19,10 @@
#include <elf.h>
#include <sys/types.h>

View File

@ -10,9 +10,11 @@ Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,8 @@ LIBS := -lsnappy $(LIBS)
Index: makedumpfile-1.7.1/Makefile
===================================================================
--- makedumpfile-1.7.1.orig/Makefile
+++ makedumpfile-1.7.1/Makefile
@@ -82,6 +82,8 @@ CFLAGS += -fsanitize=undefined
#CFLAGS += -fanalyzer
endif
@ -21,12 +23,12 @@ Signed-off-by: Petr Tesarik <ptesarik@suse.com>
LIBS := $(LIBS) -lpthread
try-run = $(shell set -e; \
@@ -101,7 +103,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(
gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz
@@ -120,7 +122,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(
$(VPATH)makedumpfile.conf.5.in > $(VPATH)makedumpfile.conf.5
eppic_makedumpfile.so: extension_eppic.c
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic ${TINFOLIB}
clean:
rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz
rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8 makedumpfile.conf.5

View File

@ -12,10 +12,11 @@ Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
makedumpfile.c | 4 ++++
makedumpfile.h | 3 +++
3 files changed, 9 insertions(+), 1 deletion(-)
diff -ur a/arch/ppc64.c b/arch/ppc64.c
--- a/arch/ppc64.c 2018-12-04 21:21:52.000000000 +0100
+++ b/arch/ppc64.c 2019-07-05 11:25:20.318510887 +0200
@@ -248,7 +248,9 @@
Index: makedumpfile-1.7.1/arch/ppc64.c
===================================================================
--- makedumpfile-1.7.1.orig/arch/ppc64.c
+++ makedumpfile-1.7.1/arch/ppc64.c
@@ -248,7 +248,9 @@ ppc64_vmalloc_init(void)
if (info->kernel_version >= KERNEL_VERSION(4, 12, 0)) {
info->l2_index_size = PMD_INDEX_SIZE_L4_64K_4_12;
@ -26,10 +27,11 @@ diff -ur a/arch/ppc64.c b/arch/ppc64.c
info->l3_index_size = PUD_INDEX_SIZE_L4_64K_4_17;
else
info->l3_index_size = PUD_INDEX_SIZE_L4_64K_4_12;
diff -ur a/makedumpfile.c b/makedumpfile.c
--- a/makedumpfile.c 2018-12-04 21:21:52.000000000 +0100
+++ b/makedumpfile.c 2019-07-05 11:23:32.357093984 +0200
@@ -2296,6 +2296,8 @@
Index: makedumpfile-1.7.1/makedumpfile.c
===================================================================
--- makedumpfile-1.7.1.orig/makedumpfile.c
+++ makedumpfile-1.7.1/makedumpfile.c
@@ -2491,6 +2491,8 @@ write_vmcoreinfo_data(void)
WRITE_NUMBER_UNSIGNED("kimage_voffset", kimage_voffset);
#endif
@ -38,7 +40,7 @@ diff -ur a/makedumpfile.c b/makedumpfile.c
if (info->phys_base)
fprintf(info->file_vmcoreinfo, "%s%lu\n", STR_NUMBER("phys_base"),
info->phys_base);
@@ -2696,6 +2698,8 @@
@@ -2939,6 +2941,8 @@ read_vmcoreinfo(void)
READ_NUMBER("HUGETLB_PAGE_DTOR", HUGETLB_PAGE_DTOR);
@ -47,10 +49,11 @@ diff -ur a/makedumpfile.c b/makedumpfile.c
return TRUE;
}
diff -ur a/makedumpfile.h b/makedumpfile.h
--- a/makedumpfile.h 2018-12-04 21:21:52.000000000 +0100
+++ b/makedumpfile.h 2019-07-05 11:23:32.353093931 +0200
@@ -1936,6 +1936,9 @@
Index: makedumpfile-1.7.1/makedumpfile.h
===================================================================
--- makedumpfile-1.7.1.orig/makedumpfile.h
+++ makedumpfile-1.7.1/makedumpfile.h
@@ -2069,6 +2069,9 @@ struct number_table {
unsigned long PHYS_OFFSET;
unsigned long kimage_voffset;
#endif

View File

@ -1,47 +0,0 @@
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Date: Tue Jan 25 12:55:15 2022 +0000
Subject: sadump, kaslr: fix failure of calculating kaslr_offset
References: bsc#1196736
Upstream: merged
Git-commit: 59b1726fbcc251155140c8a1972384498fee4daf
On kernels v5.8 or later, makedumpfile fails for memory dumps in the
sadump-related formats as follows:
# makedumpfile -f -l -d 31 -x ./vmlinux /dev/sdd4 /root/vmcore-ld31
__vtop4_x86_64: Can't get a valid pud_pte.
...110 lines of the same message...
__vtop4_x86_64: Can't get a valid pud_pte.
calc_kaslr_offset: failed to calculate kaslr_offset and phys_base; default to 0
readmem: type_addr: 1, addr:ffffffff85411858, size:8
__vtop4_x86_64: Can't get pgd (page_dir:ffffffff85411858).
readmem: Can't convert a virtual address(ffffffff059be980) to physical address.
readmem: type_addr: 0, addr:ffffffff059be980, size:1024
cpu_online_mask_init: Can't read cpu_online_mask memory.
makedumpfile Failed.
This is caused by the kernel commit 9d06c4027f21 ("x86/entry: Convert
Divide Error to IDTENTRY") that renamed divide_error to
asm_exc_divide_error, breaking logic for calculating kaslr offset.
Fix this by adding initialization of asm_exc_divide_error.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
makedumpfile.c | 2 ++
1 file changed, 2 insertions(+)
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -1634,6 +1634,8 @@ get_symbol_info(void)
SYMBOL_INIT(cur_cpu_spec, "cur_cpu_spec");
SYMBOL_INIT(divide_error, "divide_error");
+ if (SYMBOL(divide_error) == NOT_FOUND_SYMBOL)
+ SYMBOL_INIT(divide_error, "asm_exc_divide_error");
SYMBOL_INIT(idt_table, "idt_table");
SYMBOL_INIT(saved_command_line, "saved_command_line");
SYMBOL_INIT(pti_init, "pti_init");

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Apr 20 08:55:43 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>
- Update to 1.7.1:
* support for kernel up to 5.17
* sadump: remove variable length array
* print error when reading with unsupported compression
- Drop upstreamed makedumpfile-sadump-kaslr-fix-kaslr_offset-calculation.patch
-------------------------------------------------------------------
Mon Mar 21 11:22:52 UTC 2022 - Petr Tesařík <ptesarik@suse.com>

View File

@ -40,7 +40,7 @@
# End of compatibility cruft
Name: makedumpfile
Version: 1.7.0
Version: 1.7.1
Release: 0
Summary: Partial kernel dump
License: GPL-2.0-only
@ -51,7 +51,6 @@ Source99: %{name}-rpmlintrc
Patch0: %{name}-override-libtinfo.patch
Patch1: %{name}-ppc64-VA-range-SUSE.patch
Patch2: %{name}-PN_XNUM.patch
Patch3: %{name}-sadump-kaslr-fix-kaslr_offset-calculation.patch
BuildRequires: libbz2-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
@ -76,11 +75,7 @@ and can compress the page data. The obtained dump file can by analyzed
via gdb or crash utility.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%autosetup -p1
%build
export CFLAGS="%{optflags} -fcommon"