Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
edbde128fc
!149 [sync] PR-148: fix segmentation fault in value_search_module_6_4()
From: @openeuler-sync-bot 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2025-04-29 06:20:51 +00:00
wangxiao65
43e719e5c5 fix segmentation fault in value_search_module_6_4()
(cherry picked from commit f6332c374b4635b619527217641eb4f774b2423c)
2025-04-28 19:06:46 +08:00
openeuler-ci-bot
b17fc1f05f
!145 [sync] PR-144: crash: add support for sw64
From: @openeuler-sync-bot 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2025-04-28 02:51:42 +00:00
Gu Zitao
e52deb9eb4 crash: add support for sw64
Signed-off-by: Gu Zitao <guzitao@wxiat.com>
(cherry picked from commit 22074d8265c9eadeb7d24781fa8da26f04a3b3d3)
2025-04-28 10:11:17 +08:00
openeuler-ci-bot
cf1ac9c504
!135 [sync] PR-133: 同步PR!103修复源码包同源异构问题
From: @openeuler-sync-bot 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2024-12-20 02:04:48 +00:00
沈仲伟
7e4a08e09b remove the architecture judgment in the patches section; include all patches in the source package.
(cherry picked from commit 9f0de9c61411a9a3fa66b865314ce99dba3adc25)
2024-12-06 14:09:36 +08:00
openeuler-ci-bot
957b33e740
!125 arm64: fix SDEI stack frame unwind while UNW_4_14 is set
From: @wangxiao65 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2024-12-03 01:39:15 +00:00
wangxiao65
d689f40141 arm64: fix SDEI stack frame unwind while UNW_4_14 is set 2024-11-29 06:35:14 +00:00
openeuler-ci-bot
5bf3874cc2
!120 use autosetup instead of setup in prep stage
From: @wangxiao65 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2024-11-19 03:07:48 +00:00
wangxiao65
52b38354fa use autosetup instead of setup in prep stage 2024-11-13 06:45:43 +00:00
openeuler-ci-bot
74e7c274c7
!116 arm64:fix a potential segfault when unwind frame
From: @wangxiao65 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2024-11-12 08:21:00 +00:00
5 changed files with 106043 additions and 3116 deletions

File diff suppressed because it is too large Load Diff

105884
0002-crash-8.0.4-sw64.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
From 45685956da58b15d4542d59b95888b1968980c68 Mon Sep 17 00:00:00 2001
From: Xiaoguang Wang <lege.wang@jaguarmicro.com>
Date: Thu, 7 Nov 2024 14:40:07 +0800
Subject: [PATCH] arm64: fix SDEI stack frame unwind while UNW_4_14 is set
Fix two bugs:
1) If BT_IRQSTACK is set, both irq_stack and sdei_normal_stack need
to be checked while switching to process stack.
2) Use bt->frameptr in arm64_unwind_frame() just like irq stack.
Fixes: 442da89f4898 ("crash: add SDEI stack resolution")
Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
---
arm64.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arm64.c b/arm64.c
index b99baa3..34c3b08 100644
--- a/arm64.c
+++ b/arm64.c
@@ -3244,10 +3244,10 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
if (machdep->flags & UNW_4_14) {
if (((bt->flags & BT_IRQSTACK) &&
- !arm64_on_irq_stack(bt->tc->processor, frame->fp)) ||
+ !arm64_on_irq_stack(bt->tc->processor, frame->fp) &&
+ !arm64_in_sdei_normal_stack(bt->tc->processor, frame->fp)) ||
((bt->flags & BT_OVERFLOW_STACK) &&
- !arm64_on_overflow_stack(bt->tc->processor, frame->fp)) &&
- !arm64_in_sdei_normal_stack(bt->tc->processor, frame->fp)) {
+ !arm64_on_overflow_stack(bt->tc->processor, frame->fp))) {
if (arm64_on_process_stack(bt, frame->fp)) {
arm64_set_process_stack(bt);
@@ -3696,7 +3696,7 @@ arm64_back_trace_cmd(struct bt_info *bt)
arm64_set_overflow_stack(bt);
bt->flags |= BT_OVERFLOW_STACK;
}
- if (arm64_in_sdei_normal_stack(bt->tc->processor, bt->bptr)) {
+ if (arm64_in_sdei_normal_stack(bt->tc->processor, bt->frameptr)) {
arm64_set_sdei_normal_stack(bt);
bt->flags |= BT_IRQSTACK;
}
--
2.34.1

View File

@ -0,0 +1,76 @@
From ced754d3f8ce796d0d894dbb0f340e9c905c206a Mon Sep 17 00:00:00 2001
From: Tao Liu <ltao@redhat.com>
Date: Wed, 3 Apr 2024 15:06:54 +0800
Subject: [PATCH] Fix segmentation fault in value_search_module_6_4()
The following segmentation fault occurred during session initialization:
$ crash vmlinx vmcore
...
please wait... (determining panic task)Segmentation fault
Here is the backtrace of the crash-utility:
(gdb) bt
#0 value_search_module_6_4 (value=18446603338276298752, offset=0x7ffffffface0) at symbols.c:5564
#1 0x0000555555812bd0 in value_to_symstr (value=18446603338276298752,
buf=buf@entry=0x7fffffffb9c0 "", radix=10, radix@entry=0) at symbols.c:5872
#2 0x00005555557694a2 in display_memory (addr=<optimized out>, count=2048, flag=208,
memtype=memtype@entry=1, opt=opt@entry=0x0) at memory.c:1740
#3 0x0000555555769e1f in raw_stack_dump (stackbase=<optimized out>, size=<optimized out>)
at memory.c:2194
#4 0x00005555557923ff in get_active_set_panic_task () at task.c:8639
#5 0x00005555557930d2 in get_dumpfile_panic_task () at task.c:7628
#6 0x00005555557a89d3 in panic_search () at task.c:7380
#7 get_panic_context () at task.c:6267
#8 task_init () at task.c:687
#9 0x00005555557305b3 in main_loop () at main.c:787
...
This is due to lack of existence check on module symbol table. Not all
mod_mem_type will be existent for a module, e.g. in the following module
case:
(gdb) p lm->symtable[0]
$1 = (struct syment *) 0x4dcbad0
(gdb) p lm->symtable[1]
$2 = (struct syment *) 0x4dcbb70
(gdb) p lm->symtable[2]
$3 = (struct syment *) 0x4dcbc10
(gdb) p lm->symtable[3]
$4 = (struct syment *) 0x0
(gdb) p lm->symtable[4]
$5 = (struct syment *) 0x4dcbcb0
(gdb) p lm->symtable[5]
$6 = (struct syment *) 0x4dcbd00
(gdb) p lm->symtable[6]
$7 = (struct syment *) 0x0
MOD_RO_AFTER_INIT(3) and MOD_INIT_RODATA(6) do not exist, which should
be skipped, otherwise the segmentation fault will happen.
Fixes: 7750e61fdb2a ("Support module memory layout change on Linux 6.4")
Closes: https://github.com/crash-utility/crash/issues/176
Reported-by: Naveen Chaudhary <naveenchaudhary2010@hotmail.com>
Signed-off-by: Tao Liu <ltao@redhat.com>
Conflict: NA
Reference:https://github.com/crash-utility/crash/commit/ced754d3f8ce796d0d894dbb0f340e9c905c206a
---
symbols.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/symbols.c b/symbols.c
index cbc9ed13..b7627a83 100644
--- a/symbols.c
+++ b/symbols.c
@@ -5577,6 +5577,9 @@ value_search_module_6_4(ulong value, ulong *offset)
continue;
for_each_mod_mem_type(t) {
+ if (!lm->symtable[t])
+ continue;
+
sp = lm->symtable[t];
sp_end = lm->symend[t];

View File

@ -1,6 +1,6 @@
Name: crash
Version: 8.0.4
Release: 7
Release: 12
Summary: Linux kernel crash utility.
License: GPLv3
URL: https://crash-utility.github.io
@ -9,11 +9,18 @@ Source1: http://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz
Patch0: 0000-lzo_snappy.patch
Patch1: 0001-add-SDEI-stack-resolution.patch
Patch2: 0002-crash-8.0.2-sw.patch
%ifarch sw_64
Patch2: 0002-crash-8.0.4-sw64.patch
%else
%ifarch loongarch64
Patch3: 0003-crash-8.0.4-add-support-for-loongarch64.patch
Patch4: 0004-support-vmp_area_list-replaced-with-VMALLOC_START.patch
%endif
Patch5: 0005-gdb-ignore-Wenum-constexpr-conversion-in-enum-flags.patch
Patch6: 0006-arm64-fix-a-potential-segfault-when-unwind-frame.patch
Patch7: 0007-arm64-fix-SDEI-stack-frame-unwind-while-UNW_4_14-is-.patch
Patch8: 0008-Fix-segmentation-fault-in-value_search_module_6_4.patch
%endif
BuildRequires: ncurses-devel zlib-devel lzo-devel snappy-devel texinfo libzstd-devel
BuildRequires: gcc gcc-c++ bison m4
@ -44,18 +51,21 @@ created by manufacturer-specific firmware.
%package_help
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%ifarch sw_64
%patch2 -p1
%endif
%autosetup -n %{name}-%{version} -p1
%else
%setup -n %{name}-%{version}
%patch 0 -p1
%patch 1 -p1
%ifarch loongarch64
%patch3 -p1
%patch4 -p1
%patch 3 -p1
%patch 4 -p1
%endif
%autopatch -m5 -p1
%endif
%patch5 -p1
%patch6 -p1
%build
cp %{SOURCE1} .
@ -90,6 +100,22 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h
%{_mandir}/man8/crash.8*
%changelog
* Mon Apr 28 2025 wangxiao <wangxiao184@h-partners.com> - 8.0.4-12
- fix segmentation fault in value_search_module_6_4()
* Tue Apr 15 2025 Gu Zitao <guzitao@wxiat.com> - 8.0.4-11
- crash: add support for sw64
* Thu Dec 05 2024 shenzhongwei <shenzhongwei@kylinos.cn> - 8.0.4-10
- remove the architecture judgment in the patches section;
- include all patches in the source package.
* Fri Nov 29 2024 wangxiao <wangxiao184@h-partners.com> - 8.0.4-9
- arm64: fix SDEI stack frame unwind while UNW_4_14 is set
* Wed Nov 13 2024 wangxiao <wangxiao184@h-partners.com> - 8.0.4-8
- use autosetup instead of setup in prep stage
* Tue Nov 12 2024 wangxiao <wangxiao184@h-partners.com> - 8.0.4-7
- arm64: fix a potential segfault when unwind frame