Hello community, here is the log from the commit of package crash for openSUSE:Factory checked in at 2019-04-24 13:57:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crash (Old) and /work/SRC/openSUSE:Factory/.crash.new.5536 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crash" Wed Apr 24 13:57:22 2019 rev:152 rq:697206 version:7.2.5 Changes: -------- --- /work/SRC/openSUSE:Factory/crash/crash.changes 2019-02-25 18:01:34.178072976 +0100 +++ /work/SRC/openSUSE:Factory/.crash.new.5536/crash.changes 2019-04-24 13:57:29.763984411 +0200 @@ -1,0 +2,19 @@ +Tue Apr 23 09:21:32 UTC 2019 - Michal Kubecek <[email protected]> + +- Upgrade the source tarball to version 7.2.5 +- drop patches obsoleted by version upgrade: + * crash-fix-snprintf-overflow.patch + * crash-stop_read_error_when_intent_is_retry.patch + * crash-update-recognition-of-x86_64-CPU_ENTRY_AREA.patch +- post-7.2.5 upstream patches for kernel 5.0/5.1 compatibility: + * crash-fix-for-4.20-without-CONFIG_RANDOMIZE_BASE.patch + * crash-fix-for-virsh-dump-dumps-with-KASLR.patch + * crash-fix-kmem-z-on-kernel-5.0.patch + * crash-fix-kmem-i-on-kernel-5.0.patch + * crash-fix-sym-for-module-symbols-on-kernel-5.0.patch + * crash-fix-dis-function-for-module-symbols-on-kernel-5.0.patch + * crash-handle-radix_tree_root-changes-in-post-5.1-kernels.patch + * crash-find-kernel-configuration-data-with-kernel-5.1.patch + * crash-fix-dev-dD-on-kernel-5.1.patch + +------------------------------------------------------------------- Old: ---- crash-7.2.3.tar.gz crash-fix-snprintf-overflow.patch crash-stop_read_error_when_intent_is_retry.patch crash-update-recognition-of-x86_64-CPU_ENTRY_AREA.patch New: ---- crash-7.2.5.tar.gz crash-find-kernel-configuration-data-with-kernel-5.1.patch crash-fix-dev-dD-on-kernel-5.1.patch crash-fix-dis-function-for-module-symbols-on-kernel-5.0.patch crash-fix-for-4.20-without-CONFIG_RANDOMIZE_BASE.patch crash-fix-for-virsh-dump-dumps-with-KASLR.patch crash-fix-kmem-i-on-kernel-5.0.patch crash-fix-kmem-z-on-kernel-5.0.patch crash-fix-sym-for-module-symbols-on-kernel-5.0.patch crash-handle-radix_tree_root-changes-in-post-5.1-kernels.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crash.spec ++++++ --- /var/tmp/diff_new_pack.A2g4RE/_old 2019-04-24 13:57:30.835983739 +0200 +++ /var/tmp/diff_new_pack.A2g4RE/_new 2019-04-24 13:57:30.835983739 +0200 @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # # needssslcertforbuild @@ -56,7 +56,7 @@ Summary: Crash utility for live systems; netdump, diskdump, LKCD or mcore dumpfiles License: GPL-3.0-or-later AND GFDL-1.2-only Group: Development/Tools/Debuggers -Version: 7.2.3 +Version: 7.2.5 Release: 0 Source: %{name}-%{version}.tar.gz Source2: crash_whitepaper-%{whitepaper_version}.tar.bz2 @@ -82,11 +82,17 @@ Patch13: %{name}-patch-gdb.patch Patch15: %{name}_enable_snappy_support.patch Patch16: eppic-support-arm64.patch -Patch18: %{name}-stop_read_error_when_intent_is_retry.patch Patch21: %{name}-allow-use-of-sadump-captured-KASLR-kernel.patch -Patch22: %{name}-fix-snprintf-overflow.patch -Patch23: %{name}-update-recognition-of-x86_64-CPU_ENTRY_AREA.patch Patch24: %{name}-xen-invalid-pcpu-vaddr-use-hardware-domain-symbol.patch +Patch25: %{name}-fix-for-4.20-without-CONFIG_RANDOMIZE_BASE.patch +Patch26: %{name}-fix-for-virsh-dump-dumps-with-KASLR.patch +Patch27: %{name}-fix-kmem-z-on-kernel-5.0.patch +Patch28: %{name}-fix-kmem-i-on-kernel-5.0.patch +Patch29: %{name}-fix-sym-for-module-symbols-on-kernel-5.0.patch +Patch30: %{name}-fix-dis-function-for-module-symbols-on-kernel-5.0.patch +Patch31: %{name}-handle-radix_tree_root-changes-in-post-5.1-kernels.patch +Patch32: %{name}-find-kernel-configuration-data-with-kernel-5.1.patch +Patch33: %{name}-fix-dev-dD-on-kernel-5.1.patch Patch90: %{name}-sial-ps-2.6.29.diff BuildRequires: bison BuildRequires: flex @@ -281,11 +287,17 @@ %patch10 -p1 %patch11 -p1 %patch13 -p1 -%patch18 -p1 %patch21 -p1 -%patch22 -p1 -%patch23 -p1 %patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 %if %{have_snappy} %patch15 -p1 %endif ++++++ crash-7.2.3.tar.gz -> crash-7.2.5.tar.gz ++++++ /work/SRC/openSUSE:Factory/crash/crash-7.2.3.tar.gz /work/SRC/openSUSE:Factory/.crash.new.5536/crash-7.2.5.tar.gz differ: char 5, line 1 ++++++ crash-find-kernel-configuration-data-with-kernel-5.1.patch ++++++ From: Dave Anderson <[email protected]> Date: Tue, 26 Mar 2019 17:26:18 -0400 Subject: find kernel configuration data with kernel 5.1 Patch-mainline: 7.2.6 Git-commit: 9f168fb560bffe2116208cc1c947a95ef612f4fb Fix to find the kernel configuration data in Linux 5.1 kernels containing commit 13610aa908dcfce77135bb799c0a10d0172da6ba, titled "kernel/configs: use .incbin directive to embed config_data.gz". Without the patch, new kernels configured with CONFIG_IKCONFIG_PROC will display "WARNING: could not find MAGIC_START!" during session initialization, and also when running "sys config" during runtime. ([email protected]) --- kernel.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/kernel.c +++ b/kernel.c @@ -10070,6 +10070,7 @@ read_in_kernel_config(int command) struct syment *sp; int ii, jj, ret, end, found=0; unsigned long size, bufsz; + uint64_t magic; char *pos, *ln, *buf, *head, *tail, *val, *uncomp; char line[512]; z_stream stream; @@ -10111,8 +10112,17 @@ again: if (strstr(buf, MAGIC_START)) head = buf + MAGIC_SIZE + 10; /* skip past MAGIC_START and gzip header */ else { - error(WARNING, "could not find MAGIC_START!\n"); - goto out2; + /* + * Later versions put the magic number before the compressed data. + */ + if (readmem(sp->value - 8, KVADDR, &magic, 8, + "kernel_config_data MAGIC_START", RETURN_ON_ERROR) && + STRNEQ(&magic, MAGIC_START)) { + head = buf + 10; + } else { + error(WARNING, "could not find MAGIC_START!\n"); + goto out2; + } } tail = head; ++++++ crash-fix-dev-dD-on-kernel-5.1.patch ++++++ From: Dave Anderson <[email protected]> Date: Mon, 15 Apr 2019 15:48:49 -0400 Subject: fix "dev -[dD]" on kernel 5.1 Patch-mainline: 7.2.6 Git-commit: dc70e6a5e0f6f9823070d647b545a8a9282c388e Fix for the "dev -[dD]" options on Linux 5.1-rc1 and later kernels that contain commit 570d0200123fb4f809aa2f6226e93a458d664d70, titled "driver core: move device->knode_class to device_private". Without the patch, the command options fail with the error message "dev: invalid structure member offset: device_knode_class". ([email protected]) --- defs.h | 1 + dev.c | 34 ++++++++++++++++++++++++++++++++-- symbols.c | 2 ++ 3 files changed, 35 insertions(+), 2 deletions(-) --- a/defs.h +++ b/defs.h @@ -2067,6 +2067,7 @@ struct offset_table { /* stash of commonly-used offsets */ long xa_node_shift; long hd_struct_dkstats; long disk_stats_in_flight; + long device_private_knode_class; }; struct size_table { /* stash of commonly-used sizes */ --- a/dev.c +++ b/dev.c @@ -4020,6 +4020,21 @@ get_gendisk_4(unsigned long entry) OFFSET(gendisk_part0); } +/* kernel version >= 5.1 */ +static unsigned long +get_gendisk_5(unsigned long entry) +{ + unsigned long device_address; + unsigned long device_private_address; + + device_private_address = entry - OFFSET(device_private_knode_class); + readmem(device_private_address + OFFSET(device_private_device), + KVADDR, &device_address, sizeof(device_address), + "device_private.device", FAULT_ON_ERROR); + + return device_address - OFFSET(hd_struct_dev) - OFFSET(gendisk_part0); +} + /* 2.6.24 < kernel version <= 2.6.27 */ static int match_list(struct iter *i, unsigned long entry) @@ -4042,8 +4057,18 @@ match_klist(struct iter *i, unsigned long entry) { unsigned long device_address; unsigned long device_type; + unsigned long device_private_address; - device_address = entry - OFFSET(device_knode_class); + if (VALID_MEMBER(device_knode_class)) + device_address = entry - OFFSET(device_knode_class); + else { + /* kernel version >= 5.1 */ + device_private_address = entry - + OFFSET(device_private_knode_class); + readmem(device_private_address + OFFSET(device_private_device), + KVADDR, &device_address, sizeof(device_address), + "device_private.device", FAULT_ON_ERROR); + } readmem(device_address + OFFSET(device_type), KVADDR, &device_type, sizeof(device_type), "device.type", FAULT_ON_ERROR); if (device_type != i->type_address) @@ -4348,8 +4373,10 @@ init_iter(struct iter *i) i->match = match_klist; if (VALID_MEMBER(gendisk_dev)) i->get_gendisk = get_gendisk_3; - else + else if (VALID_MEMBER(device_knode_class)) i->get_gendisk = get_gendisk_4; + else + i->get_gendisk = get_gendisk_5; } } else { option_not_supported('d'); @@ -4470,6 +4497,9 @@ void diskio_init(void) MEMBER_OFFSET_INIT(device_knode_class, "device", "knode_class"); MEMBER_OFFSET_INIT(device_node, "device", "node"); MEMBER_OFFSET_INIT(device_type, "device", "type"); + MEMBER_OFFSET_INIT(device_private_device, "device_private", "device"); + MEMBER_OFFSET_INIT(device_private_knode_class, "device_private", + "knode_class"); MEMBER_OFFSET_INIT(gendisk_dev, "gendisk", "dev"); if (INVALID_MEMBER(gendisk_dev)) MEMBER_OFFSET_INIT(gendisk_dev, "gendisk", "__dev"); --- a/symbols.c +++ b/symbols.c @@ -10114,6 +10114,8 @@ dump_offset_table(char *spec, ulong makestruct) OFFSET(device_private_device)); fprintf(fp, " device_private_knode_bus: %ld\n", OFFSET(device_private_knode_bus)); + fprintf(fp, " device_private_knode_class: %ld\n", + OFFSET(device_private_knode_class)); fprintf(fp, " gendisk_dev: %ld\n", OFFSET(gendisk_dev)); fprintf(fp, " gendisk_kobj: %ld\n", ++++++ crash-fix-dis-function-for-module-symbols-on-kernel-5.0.patch ++++++ From: Dave Anderson <[email protected]> Date: Fri, 22 Mar 2019 13:26:44 -0400 Subject: fix "dis <function>" for module symbols on kernel 5.0 Patch-mainline: 7.2.6 Git-commit: 2eadad07aab21897762250ce93f52f631683eae1 Fix for the "dis <function>" option with kernel module text symbols on Linux 5.0 and later kernels. Without the patch, the disassembly may stop prematurely or extend into the next function because the st_size member of the Elf32_Sym or Elf64_Sym text symbol structures can no longer be used as the function size. ([email protected]) --- symbols.c | 3 +++ 1 file changed, 3 insertions(+) --- a/symbols.c +++ b/symbols.c @@ -2992,6 +2992,9 @@ kallsyms_module_function_size(struct syment *sp, struct load_module *lm, ulong * if (!(lm->mod_flags & MOD_KALLSYMS) || !(kt->flags & KALLSYMS_V2)) return FALSE; + if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not useable */ + return FALSE; + module_buf = GETBUF(lm->mod_size); modbuf = module_buf + (lm->module_struct - lm->mod_base); ++++++ crash-fix-for-4.20-without-CONFIG_RANDOMIZE_BASE.patch ++++++ From: Dave Anderson <[email protected]> Date: Fri, 18 Jan 2019 14:19:18 -0500 Subject: fix for 4.20 without CONFIG_RANDOMIZE_BASE Patch-mainline: 7.2.6 Git-commit: c63d678798c21a5379f132f124181715bb1d63d4 Fix for Linux 4.20 and later x86_64 kernels which are NOT configured with CONFIG_RANDOMIZE_BASE. Linux 4.20 introduced kernel commit d52888aa2753e3063a9d3a0c9f72f94aa9809c15, titled "x86/mm: Move LDT remap out of KASLR region on 5-level paging", which modified the 4-level and 5-level paging PAGE_OFFSET values. Without this patch, the crash session fails during initialization with the error message "crash: read error: kernel virtual address: <address> type: tss_struct ist array". For kernels prior to Linux 4.20.0 which have backports of the kernel commit, the kernel's PAGE_OFFSET value must be manually specified via the command line option "--machdep page_offset=ffff888000000000" for kernels with 4-level page tables, or "--machdep page_offset=ff11000000000000" for kernels with 5-level paging. (or alternatively the shorter version "-m page_offset=<address>" may be used). The command line option requirement may be revisited in the future. ([email protected]) --- crash.8 | 1 + defs.h | 8 ++++++-- help.c | 5 +++-- x86_64.c | 35 +++++++++++++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 6 deletions(-) --- a/crash.8 +++ b/crash.8 @@ -266,6 +266,7 @@ X86_64: vm=xen (Xen kernel virtual memory address ranges) vm=xen-rhel4 (RHEL4 Xen kernel virtual address ranges) vm=5level (5-level page tables) + page_offset=<PAGE_OFFSET-value> PPC64: vm=orig vm=2.6.14 (4-level page tables) --- a/defs.h +++ b/defs.h @@ -1,8 +1,8 @@ /* defs.h - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002-2018 David Anderson - * Copyright (C) 2002-2018 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002-2019 David Anderson + * Copyright (C) 2002-2019 Red Hat, Inc. All rights reserved. * Copyright (C) 2002 Silicon Graphics, Inc. * * This program is free software; you can redistribute it and/or modify @@ -3431,6 +3431,9 @@ struct arm64_stackframe { #define VMEMMAP_VADDR_5LEVEL 0xffd4000000000000 #define VMEMMAP_END_5LEVEL 0xffd5ffffffffffff +#define PAGE_OFFSET_4LEVEL_4_20 0xffff888000000000 +#define PAGE_OFFSET_5LEVEL_4_20 0xff11000000000000 + #define VSYSCALL_START 0xffffffffff600000 #define VSYSCALL_END 0xffffffffff601000 @@ -5921,6 +5924,7 @@ struct machine_specific { ulong ptrs_per_pgd; ulong cpu_entry_area_start; ulong cpu_entry_area_end; + ulong page_offset_force; }; #define KSYMS_START (0x1) --- a/help.c +++ b/help.c @@ -1,8 +1,8 @@ /* help.c - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002-2018 David Anderson - * Copyright (C) 2002-2018 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002-2019 David Anderson + * Copyright (C) 2002-2019 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -167,6 +167,7 @@ char *program_usage_info[] = { " vm=xen (Xen kernel virtual memory address ranges)", " vm=xen-rhel4 (RHEL4 Xen kernel virtual address ranges)", " vm=5level (5-level page tables)", + " page_offset=<PAGE_OFFSET-value>", " PPC64:", " vm=orig", " vm=2.6.14 (4-level page tables)", --- a/x86_64.c +++ b/x86_64.c @@ -1,7 +1,7 @@ /* x86_64.c -- core analysis suite * - * Copyright (C) 2004-2018 David Anderson - * Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2019 David Anderson + * Copyright (C) 2004-2019 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -381,6 +381,20 @@ x86_64_init(int when) break; case POST_GDB: + if (THIS_KERNEL_VERSION >= LINUX(4,20,0) && !(machdep->flags & RANDOMIZED)) { + machdep->machspec->page_offset = machdep->flags & VM_5LEVEL ? + PAGE_OFFSET_5LEVEL_4_20 : PAGE_OFFSET_4LEVEL_4_20; + machdep->kvbase = machdep->machspec->page_offset; + machdep->identity_map_base = machdep->machspec->page_offset; + } + /* + * --machdep page_offset forced override + */ + if (machdep->machspec->page_offset_force) { + machdep->machspec->page_offset = machdep->machspec->page_offset_force; + machdep->kvbase = machdep->machspec->page_offset; + machdep->identity_map_base = machdep->machspec->page_offset; + } if (THIS_KERNEL_VERSION >= LINUX(2,6,26) && THIS_KERNEL_VERSION < LINUX(2,6,31)) { machdep->machspec->modules_vaddr = MODULES_VADDR_2_6_26; @@ -887,6 +901,11 @@ x86_64_dump_machdep_table(ulong arg) fprintf(fp, " machspec: %016lx\n", (ulong)machdep->machspec); fprintf(fp, " userspace_top: %016lx\n", (ulong)ms->userspace_top); fprintf(fp, " page_offset: %016lx\n", (ulong)ms->page_offset); + fprintf(fp, " page_offset_force: "); + if (ms->page_offset_force) + fprintf(fp, "%016lx\n", (ulong)ms->page_offset_force); + else + fprintf(fp, "(unused)\n"); fprintf(fp, " vmalloc_start_addr: %016lx\n", (ulong)ms->vmalloc_start_addr); fprintf(fp, " vmalloc_end: %016lx\n", (ulong)ms->vmalloc_end); fprintf(fp, " modules_vaddr: %016lx\n", (ulong)ms->modules_vaddr); @@ -6022,6 +6041,18 @@ parse_cmdline_args(void) continue; } } + } else if (STRNEQ(arglist[i], "page_offset=")) { + p = arglist[i] + strlen("page_offset="); + if (strlen(p)) { + value = htol(p, RETURN_ON_ERROR|QUIET, &errflag); + + if (!errflag) { + machdep->machspec->page_offset_force = value; + error(NOTE, "setting PAGE_OFFSET to: 0x%lx\n\n", + machdep->machspec->page_offset_force); + continue; + } + } } error(WARNING, "ignoring --machdep option: %s\n", arglist[i]); ++++++ crash-fix-for-virsh-dump-dumps-with-KASLR.patch ++++++ From: Dave Anderson <[email protected]> Date: Wed, 13 Feb 2019 10:34:25 -0500 Subject: fix for "virsh dump" dumps with KASLR Patch-mainline: 7.2.6 Git-commit: 5aa3c1da3e22037aeeca8d745cec1481137c79fe Fix for determining the x86_64 "phys_base" value in dumpfiles created by the KVM "virsh dump" facility if the kernel is KASLR-enabled and does not have the phys_base value stored in vmcoreinfo data. Without the patch, the message "WARNING: cannot determine physical base address: defaulting to 0" is displayed, and the crash session fails to initialize. ([email protected]) --- x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/x86_64.c +++ b/x86_64.c @@ -6968,7 +6968,7 @@ x86_64_virt_phys_base(void) QUIET|RETURN_ON_ERROR) && STRNEQ(buf, "Linux version")) return TRUE; - for (phys = (ulong)(-MEGABYTES(16)); phys != MEGABYTES(16+1); + for (phys = (ulong)(-MEGABYTES(32)); phys != 0xfffff00000; phys += MEGABYTES(1)) { if (readmem(linux_banner_phys + phys, PHYSADDR, buf, strlen("Linux version"), "linux_banner search", ++++++ crash-fix-kmem-i-on-kernel-5.0.patch ++++++ From: Dave Anderson <[email protected]> Date: Fri, 8 Mar 2019 15:10:31 -0500 Subject: fix "kmem -i" on kernel 5.0 Patch-mainline: 7.2.6 Git-commit: 942d813cda354a5f4234fd36e9c6734140e3ffcb Fix for the "kmem -i" option on Linux 5.0 and later kernels that contain commit ca79b0c211af63fa3276f0e3fd7dd9ada2439839 titled "mm: convert totalram_pages and totalhigh_pages variables to atomic". Without the patch, the command prints some incorrect values, and besides does not print high/low memory information on kernels which are configured with CONFIG_HIGHMEM. ([email protected]) --- memory.c | 75 +++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 39 deletions(-) --- a/memory.c +++ b/memory.c @@ -910,26 +910,40 @@ vm_init(void) if (IS_VMALLOC_ADDR(vt->mem_map)) vt->flags |= V_MEM_MAP; vt->total_pages = BTOP(VTOP(vt->high_memory)); - switch (get_syment_array("totalram_pages", sp_array, 2)) - { - case 1: - get_symbol_data("totalram_pages", sizeof(ulong), - &vt->totalram_pages); - break; - case 2: - if (!(readmem(sp_array[0]->value, KVADDR, - &value1, sizeof(ulong), - "totalram_pages #1", RETURN_ON_ERROR))) + + if (symbol_exists("_totalram_pages")) { + readmem(symbol_value("_totalram_pages") + + OFFSET(atomic_t_counter), KVADDR, + &vt->totalram_pages, sizeof(ulong), + "_totalram_pages", FAULT_ON_ERROR); + } else { + switch (get_syment_array("totalram_pages", sp_array, 2)) + { + case 1: + get_symbol_data("totalram_pages", sizeof(ulong), + &vt->totalram_pages); break; - if (!(readmem(sp_array[1]->value, KVADDR, - &value2, sizeof(ulong), - "totalram_pages #2", RETURN_ON_ERROR))) - break; - vt->totalram_pages = MAX(value1, value2); - break; + case 2: + if (!(readmem(sp_array[0]->value, KVADDR, + &value1, sizeof(ulong), + "totalram_pages #1", RETURN_ON_ERROR))) + break; + if (!(readmem(sp_array[1]->value, KVADDR, + &value2, sizeof(ulong), + "totalram_pages #2", RETURN_ON_ERROR))) + break; + vt->totalram_pages = MAX(value1, value2); + break; + } } - if (symbol_exists("totalhigh_pages")) { + if (symbol_exists("_totalhigh_pages")) { + readmem(symbol_value("_totalhigh_pages") + + OFFSET(atomic_t_counter), KVADDR, + &vt->totalhigh_pages, sizeof(ulong), + "_totalhigh_pages", FAULT_ON_ERROR); + vt->total_pages += vt->totalhigh_pages; + } else if (symbol_exists("totalhigh_pages")) { switch (get_syment_array("totalhigh_pages", sp_array, 2)) { case 1: @@ -8169,7 +8183,6 @@ dump_kmeminfo(void) long nr_file_pages, nr_slab; ulong swapper_space_nrpages; ulong pct; - ulong value1, value2; uint tmp; struct meminfo meminfo; struct gnu_request req; @@ -8177,7 +8190,6 @@ dump_kmeminfo(void) ulong get_totalram; ulong get_buffers; ulong get_slabs; - struct syment *sp_array[2]; char buf[BUFSIZE]; @@ -8210,7 +8222,8 @@ dump_kmeminfo(void) * Prior to 2.3.36, count all mem_map pages minus the reserved ones. * From 2.3.36 onwards, use "totalram_pages" if set. */ - if (symbol_exists("totalram_pages")) { + if (symbol_exists("totalram_pages") || + symbol_exists("_totalram_pages")) { totalram_pages = vt->totalram_pages ? vt->totalram_pages : get_totalram; } else @@ -8362,25 +8375,9 @@ dump_kmeminfo(void) fprintf(fp, "%13s %7ld %11s %3ld%% of TOTAL MEM\n", "SLAB", get_slabs, pages_to_size(get_slabs, buf), pct); - if (symbol_exists("totalhigh_pages")) { - switch (get_syment_array("totalhigh_pages", sp_array, 2)) - { - case 1: - get_symbol_data("totalhigh_pages", sizeof(ulong), - &totalhigh_pages); - break; - case 2: - if (!(readmem(sp_array[0]->value, KVADDR, - &value1, sizeof(ulong), - "totalhigh_pages #1", RETURN_ON_ERROR))) - break; - if (!(readmem(sp_array[1]->value, KVADDR, - &value2, sizeof(ulong), - "totalhigh_pages #2", RETURN_ON_ERROR))) - break; - totalhigh_pages = MAX(value1, value2); - break; - } + if (symbol_exists("totalhigh_pages") || + symbol_exists("_totalhigh_pages")) { + totalhigh_pages = vt->totalhigh_pages; pct = totalhigh_pages ? (totalhigh_pages * 100)/totalram_pages : 0; ++++++ crash-fix-kmem-z-on-kernel-5.0.patch ++++++ From: Dave Anderson <[email protected]> Date: Thu, 7 Mar 2019 16:17:40 -0500 Subject: fix "kmem -z" on kernel 5.0 Patch-mainline: 7.2.6 Git-commit: 84f5e2a19e89236aa559f3b0d5024f3001c75a06 Fix for the "kmem -z" option on Linux 5.0 and later kernels that contain commit a921444382b49cc7fdeca3fba3e278bc09484a27, titled "mm: move zone watermark accesses behind an accessor". Without the patch, the command fails with the error message "kmem: invalid (optional) structure member offsets: zone_pages_min or zone_struct_pages_min". ([email protected]) --- memory.c | 3 +++ 1 file changed, 3 insertions(+) --- a/memory.c +++ b/memory.c @@ -1095,6 +1095,9 @@ vm_init(void) "zone", "pages_high"); MEMBER_OFFSET_INIT(zone_watermark, "zone", "watermark"); + if (INVALID_MEMBER(zone_watermark)) + MEMBER_OFFSET_INIT(zone_watermark, + "zone", "_watermark"); MEMBER_OFFSET_INIT(zone_nr_active, "zone", "nr_active"); MEMBER_OFFSET_INIT(zone_nr_inactive, ++++++ crash-fix-sym-for-module-symbols-on-kernel-5.0.patch ++++++ From: Dave Anderson <[email protected]> Date: Fri, 22 Mar 2019 10:15:38 -0400 Subject: fix "sym" for module symbols on kernel 5.0 Patch-mainline: 7.2.6 Git-commit: 302396b629ee5e9f441eb6d8041e691ebcd2c0e2 Fix for the display of kernel module symbol types by the "sym" command in Linux 5.0 and later kernels if the module debuginfo data has not been loaded into the crash session. The st_info member of the Elf32_Sym or Elf64_Sym structures has changed so as to not contain ASCII symbol type characters, and as a result the "sym" command will show unprintable data as the symbol type. With the patch, only text types ("t" or "T") will be displayed, and the symbols others will show "?". ([email protected]) --- symbols.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) --- a/symbols.c +++ b/symbols.c @@ -2194,7 +2194,14 @@ Elf32_Sym_to_common(Elf32_Sym *e32, struct elf_common *ec) ec->st_name = (ulong)e32->st_name; ec->st_value = (ulong)e32->st_value; ec->st_shndx = (ulong)e32->st_shndx; - ec->st_info = e32->st_info; + if ((e32->st_info >= ' ') && (e32->st_info < 0x7f)) + ec->st_info = e32->st_info; + else if (e32->st_info == 0x02) + ec->st_info = 't'; + else if (e32->st_info == 0x12) + ec->st_info = 'T'; + else + ec->st_info = '?'; ec->st_size = (ulong)e32->st_size; } @@ -2204,7 +2211,14 @@ Elf64_Sym_to_common(Elf64_Sym *e64, struct elf_common *ec) ec->st_name = (ulong)e64->st_name; ec->st_value = (ulong)e64->st_value; ec->st_shndx = (ulong)e64->st_shndx; - ec->st_info = e64->st_info; + if ((e64->st_info >= ' ') && (e64->st_info < 0x7f)) + ec->st_info = e64->st_info; + else if (e64->st_info == 0x02) + ec->st_info = 't'; + else if (e64->st_info == 0x12) + ec->st_info = 'T'; + else + ec->st_info = '?'; ec->st_size = (ulong)e64->st_size; } ++++++ crash-handle-radix_tree_root-changes-in-post-5.1-kernels.patch ++++++ From: Dave Anderson <[email protected]> Date: Fri, 22 Mar 2019 15:50:40 -0400 Subject: handle radix_tree_root changes in post-5.1 kernels Patch-mainline: 7.2.6 Git-commit: 4d551127014e3ad4014e6e8811bcf86d4a53d723 Commit dd12805ed1db7 in the linux-next kernel repository, titled "XArray: Remove radix tree compatibility", changes the definition of "radix_tree_root" back to be a struct. However, the content of the new structure differs from the original structure, so without the patch, current linux-next kernels fail during initialization with the error message "radix trees do not exist or have changed their format". Because the new "radix_tree_root" and "xarray" structures have nearly the same layout, the existing functionality for XArrays can be reused. ([email protected]) --- bpf.c | 7 ++++++- filesys.c | 4 +++- ipcs.c | 8 ++++++-- kernel.c | 11 ++++++++--- task.c | 15 +++++++++++---- tools.c | 5 ++++- 6 files changed, 38 insertions(+), 12 deletions(-) --- a/bpf.c +++ b/bpf.c @@ -221,7 +221,12 @@ bpf_init(struct bpf_info *bpf) bpf->idr_type = IDR_ORIG; do_old_idr(IDR_ORIG_INIT, 0, NULL); } else if (STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "radix_tree_root")) - bpf->idr_type = IDR_RADIX; + if (MEMBER_EXISTS("radix_tree_root", "rnode")) + bpf->idr_type = IDR_RADIX; + else if (MEMBER_EXISTS("radix_tree_root", "xa_head")) + bpf->idr_type = IDR_XARRAY; + else + error(FATAL, "cannot determine IDR list type\n"); else if (STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "xarray")) bpf->idr_type = IDR_XARRAY; else --- a/filesys.c +++ b/filesys.c @@ -2235,7 +2235,9 @@ dump_inode_page_cache_info(ulong inode) xarray = root_rnode = count = 0; if (MEMBER_EXISTS("address_space", "i_pages") && - STREQ(MEMBER_TYPE_NAME("address_space", "i_pages"), "xarray")) + (STREQ(MEMBER_TYPE_NAME("address_space", "i_pages"), "xarray") || + (STREQ(MEMBER_TYPE_NAME("address_space", "i_pages"), "radix_tree_root") && + MEMBER_EXISTS("radix_tree_root", "xa_head")))) xarray = i_mapping + OFFSET(address_space_page_tree); else root_rnode = i_mapping + OFFSET(address_space_page_tree); --- a/ipcs.c +++ b/ipcs.c @@ -205,8 +205,12 @@ ipcs_init(void) if (VALID_MEMBER(idr_idr_rt)) { if (STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "xarray")) ipcs_table.init_flags |= IDR_XARRAY; - else - ipcs_table.init_flags |= IDR_RADIX; + else { + if (MEMBER_EXISTS("radix_tree_root", "rnode")) + ipcs_table.init_flags |= IDR_RADIX; + else if (MEMBER_EXISTS("radix_tree_root", "xa_head")) + ipcs_table.init_flags |= IDR_XARRAY; + } } else ipcs_table.init_flags |= IDR_ORIG; --- a/kernel.c +++ b/kernel.c @@ -536,9 +536,14 @@ kernel_init() if (kernel_symbol_exists("irq_desc_tree")) { get_symbol_type("irq_desc_tree", NULL, &req); - kt->flags2 |= STREQ(req.type_tag_name, "xarray") ? - IRQ_DESC_TREE_XARRAY : IRQ_DESC_TREE_RADIX; - + if (STREQ(req.type_tag_name, "xarray")) { + kt->flags2 |= IRQ_DESC_TREE_XARRAY; + } else { + if (MEMBER_EXISTS("radix_tree_root", "xa_head")) + kt->flags2 |= IRQ_DESC_TREE_XARRAY; + else + kt->flags2 |= IRQ_DESC_TREE_RADIX; + } } STRUCT_SIZE_INIT(irq_data, "irq_data"); if (VALID_STRUCT(irq_data)) { --- a/task.c +++ b/task.c @@ -507,10 +507,17 @@ task_init(void) OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); tt->flags |= PID_XARRAY; } else if STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "radix_tree_root") { - tt->refresh_task_table = refresh_radix_tree_task_table; - tt->pid_radix_tree = symbol_value("init_pid_ns") + - OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); - tt->flags |= PID_RADIX_TREE; + if (MEMBER_EXISTS("radix_tree_root", "rnode")) { + tt->refresh_task_table = refresh_radix_tree_task_table; + tt->pid_radix_tree = symbol_value("init_pid_ns") + + OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); + tt->flags |= PID_RADIX_TREE; + } else if (MEMBER_EXISTS("radix_tree_root", "xa_head")) { + tt->refresh_task_table = refresh_xarray_task_table; + tt->pid_xarray = symbol_value("init_pid_ns") + + OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); + tt->flags |= PID_XARRAY; + } } else error(FATAL, "unknown pid_namespace.idr type: %s\n", MEMBER_TYPE_NAME("idr", "idr_rt")); --- a/tools.c +++ b/tools.c @@ -4221,7 +4221,10 @@ cmd_tree() } if (STRNEQ(optarg, "ra")) - type_flag = RADIXTREE_REQUEST; + if (MEMBER_EXISTS("radix_tree_root", "xa_head")) + type_flag = XARRAY_REQUEST; + else + type_flag = RADIXTREE_REQUEST; else if (STRNEQ(optarg, "rb")) type_flag = RBTREE_REQUEST; else if (STRNEQ(optarg, "x"))
