From fc54b30a8718c2423e0e6fa6b0936c01438d842c909a6201588a7279f50cc72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Tue, 7 Jun 2022 09:47:24 +0000 Subject: [PATCH] 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 --- makedumpfile-1.7.0.tar.gz | 3 -- makedumpfile-1.7.1.tar.gz | 3 ++ makedumpfile-PN_XNUM.patch | 6 ++- makedumpfile-override-libtinfo.patch | 14 +++--- makedumpfile-ppc64-VA-range-SUSE.patch | 29 +++++++----- ...p-kaslr-fix-kaslr_offset-calculation.patch | 47 ------------------- makedumpfile.changes | 9 ++++ makedumpfile.spec | 9 +--- 8 files changed, 42 insertions(+), 78 deletions(-) delete mode 100644 makedumpfile-1.7.0.tar.gz create mode 100644 makedumpfile-1.7.1.tar.gz delete mode 100644 makedumpfile-sadump-kaslr-fix-kaslr_offset-calculation.patch diff --git a/makedumpfile-1.7.0.tar.gz b/makedumpfile-1.7.0.tar.gz deleted file mode 100644 index 0219282..0000000 --- a/makedumpfile-1.7.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8985f8df249087ea68c6051dec6dac3ef0703fe2aa87d0266f3951f93aa8da5e -size 202820 diff --git a/makedumpfile-1.7.1.tar.gz b/makedumpfile-1.7.1.tar.gz new file mode 100644 index 0000000..526a2a3 --- /dev/null +++ b/makedumpfile-1.7.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb04b1bd0e750d0d0ac1b43b759b326d4a3797b0af08e0c269d1b155893fb664 +size 204593 diff --git a/makedumpfile-PN_XNUM.patch b/makedumpfile-PN_XNUM.patch index e96df70..42ac30e 100644 --- a/makedumpfile-PN_XNUM.patch +++ b/makedumpfile-PN_XNUM.patch @@ -9,8 +9,10 @@ Signed-off-by: Petr Tesarik 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 #include diff --git a/makedumpfile-override-libtinfo.patch b/makedumpfile-override-libtinfo.patch index cba88df..43917bc 100644 --- a/makedumpfile-override-libtinfo.patch +++ b/makedumpfile-override-libtinfo.patch @@ -10,9 +10,11 @@ Signed-off-by: Petr Tesarik 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 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 diff --git a/makedumpfile-ppc64-VA-range-SUSE.patch b/makedumpfile-ppc64-VA-range-SUSE.patch index 9740126..729d66b 100644 --- a/makedumpfile-ppc64-VA-range-SUSE.patch +++ b/makedumpfile-ppc64-VA-range-SUSE.patch @@ -12,10 +12,11 @@ Signed-off-by: Petr Tesarik 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 diff --git a/makedumpfile-sadump-kaslr-fix-kaslr_offset-calculation.patch b/makedumpfile-sadump-kaslr-fix-kaslr_offset-calculation.patch deleted file mode 100644 index 2916d4f..0000000 --- a/makedumpfile-sadump-kaslr-fix-kaslr_offset-calculation.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: HATAYAMA Daisuke -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 -Acked-by: Petr Tesarik - ---- - 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"); diff --git a/makedumpfile.changes b/makedumpfile.changes index ede308e..7b92765 100644 --- a/makedumpfile.changes +++ b/makedumpfile.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Apr 20 08:55:43 UTC 2022 - Paolo Stivanin + +- 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 diff --git a/makedumpfile.spec b/makedumpfile.spec index 91597db..c7c4e4c 100644 --- a/makedumpfile.spec +++ b/makedumpfile.spec @@ -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"