crash: fix null pointer reference when CONFIG_KASAN is open
If CONFIG_KASAN is open, CONFIG_VMAP_STACK will be closed. And the sdei_stack_normal_ptr will be undefined. When crash init the stack, sdei_stacks will not init. We should not access the sdei_stacks later, so check null pointer before access it. Signed-off-by: wangbin <wangbin224@huawei.com>
This commit is contained in:
parent
0cec8d7d9d
commit
1882a00b9d
@ -225,7 +225,7 @@ index fdf77bd..cc32d9d 100644
|
|||||||
bt->flags &= ~BT_IRQSTACK;
|
bt->flags &= ~BT_IRQSTACK;
|
||||||
if (arm64_switch_stack(bt, &stackframe, ofp) == USER_MODE)
|
if (arm64_switch_stack(bt, &stackframe, ofp) == USER_MODE)
|
||||||
break;
|
break;
|
||||||
@@ -2965,6 +3068,79 @@ arm64_in_kdump_text(struct bt_info *bt, struct arm64_stackframe *frame)
|
@@ -2965,6 +3068,81 @@ arm64_in_kdump_text(struct bt_info *bt, struct arm64_stackframe *frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -241,6 +241,8 @@ index fdf77bd..cc32d9d 100644
|
|||||||
+ return FALSE;
|
+ return FALSE;
|
||||||
+
|
+
|
||||||
+ ms = machdep->machspec;
|
+ ms = machdep->machspec;
|
||||||
|
+ if (!ms->sdei_stacks)
|
||||||
|
+ return FALSE;
|
||||||
+ cpu = bt->tc->processor;
|
+ cpu = bt->tc->processor;
|
||||||
+ stackbase = ms->sdei_stacks[cpu];
|
+ stackbase = ms->sdei_stacks[cpu];
|
||||||
+ stackbuf = GETBUF(ms->sdei_stack_size);
|
+ stackbuf = GETBUF(ms->sdei_stack_size);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Name: crash
|
Name: crash
|
||||||
Version: 7.2.9
|
Version: 7.2.9
|
||||||
Release: 4
|
Release: 5
|
||||||
Summary: Linux kernel crash utility.
|
Summary: Linux kernel crash utility.
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
URL: https://crash-utility.github.io
|
URL: https://crash-utility.github.io
|
||||||
@ -76,6 +76,9 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h
|
|||||||
%{_mandir}/man8/crash.8*
|
%{_mandir}/man8/crash.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 03 2021 wangbin <wangbin224@huawei.com> - 7.2.9-5
|
||||||
|
- fix null pointer reference when CONFIG_KASAN is open
|
||||||
|
|
||||||
* Tue Jun 29 2021 zhouwenpei <zhouwenpei1@huawei.com> - 7.2.9-4
|
* Tue Jun 29 2021 zhouwenpei <zhouwenpei1@huawei.com> - 7.2.9-4
|
||||||
- add buildrequires m4
|
- add buildrequires m4
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user