public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/crash] rawhide: Rebase to upstream crash-9.0.3
@ 2026-10-01 4:55 Tao Liu
0 siblings, 0 replies; only message in thread
From: Tao Liu @ 2026-10-01 4:55 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/crash
Branch : rawhide
Commit : 2922dca8ecb16061a20a9293e8ce00717acc87bc
Author : Tao Liu <ltao@redhat.com>
Date : 2026-10-01T17:50:12+13:00
Stats : +257/-3 in 8 file(s)
URL : https://src.fedoraproject.org/rpms/crash/c/2922dca8ecb16061a20a9293e8ce00717acc87bc?branch=rawhide
Log:
Rebase to upstream crash-9.0.3
Release: crash-9.0.3-1
Signed-off-by: Tao Liu <ltao@redhat.com>
---
diff --git a/.gitignore b/.gitignore
index e214b02..16d351e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,3 +57,4 @@ crash-5.0.6.tar.gz
/gdb-10.2.tar.gz
/gdb-16.2.tar.gz
/crash-9.0.2.tar.gz
+/crash-9.0.3.tar.gz
diff --git a/0001-arm64-move-irq-overflow-stackframe-init-to-POST_VM-p.patch b/0001-arm64-move-irq-overflow-stackframe-init-to-POST_VM-p.patch
new file mode 100644
index 0000000..3167e98
--- /dev/null
+++ b/0001-arm64-move-irq-overflow-stackframe-init-to-POST_VM-p.patch
@@ -0,0 +1,60 @@
+From e614a8c55edb39eebe44636786a243c49ef555e5 Mon Sep 17 00:00:00 2001
+From: "chenhaixiang (A)" <chenhaixiang3@h-partners.com>
+Date: Fri, 18 Sep 2026 06:57:04 +0000
+Subject: [PATCH 1/5] arm64: move irq/overflow/stackframe init to POST_VM phase
+
+When percpu data is in vmalloc area (pcpu_page_first_chunk fallback on
+large NUMA systems), arm64_kvtop() cannot translate vmalloc addresses
+during POST_GDB because vt->vmalloc_start is not yet initialized by
+vm_init(). Moving the stack init functions to POST_VM ensures
+vt->vmalloc_start and vt->kernel_pgd are ready before readmem calls.
+
+Reproduce info:
+Kernel: arm64 linux-6.6.0 with CONFIG_GENERIC_ARCH_NUMA=y,
+CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y.
+The same setup_per_cpu_areas() fallback path still exists in
+linux mainline drivers/base/arch_numa.c, so
+this should reproduce on current mainline as well.
+On a QEMU arm64 VM, add "percpu_alloc=page" to the kernel cmdline
+to force pcpu_page_first_chunk(), so percpu lives in vmalloc.
+Then:
+ # makedumpfile -d 31 /proc/kcore vmcore
+ # ./crash vmlinux vmcore
+crash log:
+ crash: seek error: kernel virtual address: ffff800100000050 type: "IRQ stack pointer"
+ crash: seek error: kernel virtual address: ffff800100021050 type: "IRQ stack pointer"
+ crash: seek error: kernel virtual address: ffff800100042050 type: "IRQ stack pointer"
+ crash: seek error: kernel virtual address: ffff800100063050 type: "IRQ stack pointer"
+ ...
+ KERNEL: vmlinux [TAINTED]
+ DUMPFILE: vmcore [PARTIAL DUMP]
+ CPUS: 4
+ RELEASE: 6.6.0.aarch64
+ MACHINE: aarch64 (unknown Mhz)
+ MEMORY: 4 GB
+ ...
+
+Signed-off-by: Chen Haixiang <chenhaixiang3@h-partners.com>
+Acked-by: Dave Young <yangrr.2009@tsinghua.org.cn>
+Signed-off-by: Dave Young <yangrr.2009@tsinghua.org.cn>
+---
+ arm64.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arm64.c b/arm64.c
+index d17709299b2d..654b9726cfe1 100644
+--- a/arm64.c
++++ b/arm64.c
+@@ -787,7 +787,9 @@ arm64_init(int when)
+ */
+ if(!machdep->machspec->CONFIG_ARM64_KERNELPACMASK)
+ arm64_recalc_KERNELPACMASK();
++ break;
+
++ case POST_VM:
+ arm64_irq_stack_init();
+ arm64_overflow_stack_init();
+ arm64_stackframe_init();
+--
+2.54.0
+
diff --git a/0002-netdump.c-validate-sh_info-value-before-use.patch b/0002-netdump.c-validate-sh_info-value-before-use.patch
new file mode 100644
index 0000000..bea77d4
--- /dev/null
+++ b/0002-netdump.c-validate-sh_info-value-before-use.patch
@@ -0,0 +1,49 @@
+From 5e3efcf269c7a6ff049896de0042fa1bfbea75b8 Mon Sep 17 00:00:00 2001
+From: Tao Liu <ltao@redhat.com>
+Date: Mon, 7 Sep 2026 14:27:38 +1200
+Subject: [PATCH 2/5] netdump.c: validate sh_info value before use
+
+A sh_info value less than 2 would result in an invalid PT_LOAD segment
+count due to the sh_info - 1 calculation. Detect malformed ELF section
+headers early and reject the dump with a warning/error instead of
+continuing with an invalid value.
+
+Signed-off-by: Tao Liu <ltao@redhat.com>
+---
+ netdump.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/netdump.c b/netdump.c
+index 7697613a8ea1..b224b55ffa72 100644
+--- a/netdump.c
++++ b/netdump.c
+@@ -432,6 +432,12 @@ is_netdump(char *file, ulong source_query)
+ */
+ if (nd->elf64->e_phnum == PN_XNUM) {
+ nd->sect0_64 = (Elf64_Shdr *)sect0;
++ if (nd->sect0_64->sh_info < 2) {
++ error(WARNING,
++ "%s: invalid section header sh_info: %u\n",
++ file, nd->sect0_64->sh_info);
++ goto bailout;
++ }
+ nd->num_pt_load_segments = nd->sect0_64->sh_info - 1;
+ } else
+ nd->num_pt_load_segments = nd->elf64->e_phnum - 1;
+@@ -562,6 +568,13 @@ resize_elf_header(int fd, char *file, char **eheader_ptr, char **sect0_ptr,
+ return 0;
+ }
+ }
++ if (shdr64->sh_info < 2) {
++ fprintf(stderr,
++ "%s: invalid section header sh_info: %u\n",
++ file, shdr64->sh_info);
++ free(shdr64);
++ return 0;
++ }
+ num_pt_load_segments = shdr64->sh_info - 1;
+ *sect0_ptr = (char *)shdr64;
+ } else
+--
+2.54.0
+
diff --git a/0003-vmware_vmss.c-validate-group-offsets-before-fseek.patch b/0003-vmware_vmss.c-validate-group-offsets-before-fseek.patch
new file mode 100644
index 0000000..47a21eb
--- /dev/null
+++ b/0003-vmware_vmss.c-validate-group-offsets-before-fseek.patch
@@ -0,0 +1,53 @@
+From 0aed7225fae56cdee743e01d560a3e9b63f8a099 Mon Sep 17 00:00:00 2001
+From: Tao Liu <ltao@redhat.com>
+Date: Mon, 7 Sep 2026 14:39:54 +1200
+Subject: [PATCH 3/5] vmware_vmss.c: validate group offsets before fseek
+
+Validate VMSS group offsets against LONG_MAX before passing them to
+fseek(), which accepts a signed long offset.
+
+Reject offsets that cannot be represented by long and report the
+invalid group offset instead of allowing an implementation-dependent
+conversion. Apply the same validation when initializing the VMSS dump
+and when extracting the memory dump.
+
+Signed-off-by: Tao Liu <ltao@redhat.com>
+---
+ vmware_vmss.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/vmware_vmss.c b/vmware_vmss.c
+index 3f9ad339e68e..188a6344fdbf 100644
+--- a/vmware_vmss.c
++++ b/vmware_vmss.c
+@@ -119,7 +119,12 @@ vmware_vmss_init(char *filename, FILE *ofp)
+ }
+
+ for (i = 0; i < hdr.numgroups; i++) {
+- if (fseek(fp, grps[i].position, SEEK_SET) == -1) {
++ if (grps[i].position > (uint64_t)LONG_MAX) {
++ error(INFO, LOGPRX"Offset of VMSS Group['%s'] exceeds maximum at %#llx.\n",
++ grps[i].name, (ulonglong)grps[i].position);
++ continue;
++ }
++ if (fseek(fp, (long)grps[i].position, SEEK_SET) == -1) {
+ error(INFO, LOGPRX"Bad offset of VMSS Group['%s'] in '%s' at %#llx.\n",
+ grps[i].name, filename, (ulonglong)grps[i].position);
+ continue;
+@@ -723,7 +728,12 @@ vmware_vmss_memory_dump(FILE *ofp)
+ }
+
+ for (i = 0; i < hdr.numgroups; i++) {
+- if (fseek(fp, grps[i].position, SEEK_SET) == -1) {
++ if (grps[i].position > (uint64_t)LONG_MAX) {
++ fprintf(ofp, "Offset of VMSS Group['%s'] exceeds maximum at %#llx.\n",
++ grps[i].name, (ulonglong)grps[i].position);
++ continue;
++ }
++ if (fseek(fp, (long)grps[i].position, SEEK_SET) == -1) {
+ fprintf(ofp, "Bad offset of VMSS Group['%s'] in vmss file at %#llx.\n",
+ grps[i].name, (ulonglong)grps[i].position);
+ continue;
+--
+2.54.0
+
diff --git a/0004-netdump.c-validate-ELF-note-name-size.patch b/0004-netdump.c-validate-ELF-note-name-size.patch
new file mode 100644
index 0000000..f010dd4
--- /dev/null
+++ b/0004-netdump.c-validate-ELF-note-name-size.patch
@@ -0,0 +1,50 @@
+From a42e80fa91070504091608194729ce34c8903f75 Mon Sep 17 00:00:00 2001
+From: Tao Liu <ltao@redhat.com>
+Date: Wed, 30 Sep 2026 11:31:04 +1300
+Subject: [PATCH 4/5] netdump.c: validate ELF note name size
+
+Validate n_namesz against BUFSIZE when processing ELF32 and ELF64
+notes.
+
+Reject note headers with an excessively large name size before processing
+the note data, preventing malformed ELF notes from causing an
+out-of-bounds buffer access or other invalid handling.
+
+Apply the same validation to both 32-bit and 64-bit ELF note parsing.
+
+Signed-off-by: Tao Liu <ltao@redhat.com>
+---
+ netdump.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/netdump.c b/netdump.c
+index b224b55ffa72..64d4edc781df 100644
+--- a/netdump.c
++++ b/netdump.c
+@@ -2102,8 +2102,9 @@ dump_Elf32_Nhdr(Elf32_Off offset, int store)
+
+ notesize = (uint64_t)note->n_namesz + (uint64_t)note->n_descsz;
+
+- if ((note->n_namesz == 0) || !remaining || (notesize > remaining)) {
+- error(WARNING,
++ if ((note->n_namesz == 0) || !remaining || (notesize > remaining) ||
++ (note->n_namesz >= BUFSIZE)) {
++ error(WARNING,
+ "possibly corrupt Elf32_Nhdr: "
+ "n_namesz: %ld n_descsz: %ld n_type: %lx\n%s",
+ note->n_namesz, note->n_descsz, note->n_type,
+@@ -2339,8 +2340,9 @@ dump_Elf64_Nhdr(Elf64_Off offset, int store)
+
+ notesize = (uint64_t)note->n_namesz + (uint64_t)note->n_descsz;
+
+- if ((note->n_namesz == 0) || !remaining || (notesize > remaining)) {
+- error(WARNING,
++ if ((note->n_namesz == 0) || !remaining || (notesize > remaining) ||
++ (note->n_namesz >= BUFSIZE)) {
++ error(WARNING,
+ "possibly corrupt Elf64_Nhdr: "
+ "n_namesz: %ld n_descsz: %ld n_type: %lx\n%s",
+ note->n_namesz, note->n_descsz, note->n_type,
+--
+2.54.0
+
diff --git a/0005-qemu-load.c-validate-name-length.patch b/0005-qemu-load.c-validate-name-length.patch
new file mode 100644
index 0000000..1bafaa7
--- /dev/null
+++ b/0005-qemu-load.c-validate-name-length.patch
@@ -0,0 +1,28 @@
+From e7b60257857da695f1e1a7d19252b234987487a2 Mon Sep 17 00:00:00 2001
+From: Tao Liu <ltao@redhat.com>
+Date: Wed, 30 Sep 2026 13:39:46 +1300
+Subject: [PATCH 5/5] qemu-load.c: validate name length
+
+Validate the name length before reading it into the fixed-size buffer.
+
+Signed-off-by: Tao Liu <ltao@redhat.com>
+---
+ qemu-load.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/qemu-load.c b/qemu-load.c
+index 1c17fd998068..81466f33f712 100644
+--- a/qemu-load.c
++++ b/qemu-load.c
+@@ -979,6 +979,8 @@ qemu_load (const struct qemu_device_loader *devices, uint32_t required_features,
+ }
+ if (sec == QEMU_VM_CONFIGURATION) {
+ uint32_t len = get_be32 (fp);
++ if (len >= sizeof(name))
++ goto fail;
+ get_string_len (fp, name, len);
+ continue;
+ }
+--
+2.54.0
+
diff --git a/crash.spec b/crash.spec
index c530aa5..3840049 100644
--- a/crash.spec
+++ b/crash.spec
@@ -3,8 +3,8 @@
#
Summary: Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles
Name: crash
-Version: 9.0.2
-Release: 3%{?dist}
+Version: 9.0.3
+Release: 1%{?dist}
License: GPL-3.0-only
Source0: https://github.com/crash-utility/crash/archive/crash-%{version}.tar.gz
Source1: http://ftp.gnu.org/gnu/gdb/gdb-16.2.tar.gz
@@ -19,6 +19,11 @@ Provides: bundled(libiberty)
Provides: bundled(gdb) = 16.2
Patch0: lzo_snappy_zstd.patch
Patch1: crash-9.0.1_build.patch
+Patch2: 0001-arm64-move-irq-overflow-stackframe-init-to-POST_VM-p.patch
+Patch3: 0002-netdump.c-validate-sh_info-value-before-use.patch
+Patch4: 0003-vmware_vmss.c-validate-group-offsets-before-fseek.patch
+Patch5: 0004-netdump.c-validate-ELF-note-name-size.patch
+Patch6: 0005-qemu-load.c-validate-name-length.patch
%description
The core analysis suite is a self-contained tool that can be used to
@@ -40,6 +45,11 @@ offered by Mission Critical Linux, or the LKCD kernel patch.
%setup -n %{name}-%{version} -q
%patch -P 0 -p1 -b lzo_snappy_zstd.patch
%patch -P 1 -p1
+%patch -P 2 -p1
+%patch -P 3 -p1
+%patch -P 4 -p1
+%patch -P 5 -p1
+%patch -P 6 -p1
%build
@@ -65,6 +75,9 @@ cp -p defs.h %{buildroot}%{_includedir}/crash
%{_includedir}/*
%changelog
+* Thu Oct 1 2026 Tao Liu <ltao@redhat.com> - 9.0.3-1
+- Rebase to upstream crash 9.0.3
+
* Fri Jul 24 2026 Sun Haiyong <sunhaiyong@zdbr.net> - 9.0.2-3
- enable loongarch64 support.
diff --git a/sources b/sources
index 5a355d8..80dd2e7 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
SHA512 (gdb-16.2.tar.gz) = c44a6cf6cdd6e92f1f4dda7d888ce3e7fdde65ca8736092e2b0a4c369ea09b499824a1d078f668f276fa6d00d311e9ec485231cb7b841479a4fabbfd65778084
-SHA512 (crash-9.0.2.tar.gz) = c51164065ad7c65e8fda91c01b514b464e38197674e738f496e32669f749c8a34c60c1e65f435cfc23b7b035f5f8022c7a3ef39fb4de8cb42adb3f0537b1f72d
+SHA512 (crash-9.0.3.tar.gz) = 90c8cb0714f91b9bff5e4f1c81ec0c43cc8850715b554a364a85b7948142034515093e1329d079c9618a8d67e1a7809e2c35b85e178110578c502b296a9b4157
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-01 4:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 4:55 [rpms/crash] rawhide: Rebase to upstream crash-9.0.3 Tao Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox