[PATCH v3] Fix "log" command when crash is started with "--minimal" option
by Dave Wysochanski
Commit c86250bce29f introduced the useful '-T' option to print the
log timestamp in human-readable form. However, this option does
not work when crash is invoked with '--minimal' mode, and if tried,
crash will spin at 100% and continuously crash at a divide by 0
because machdep->hz == 0.
Fix this by disallowing this option in minimal mode. In addition,
only calculate the logic to calculate kt->boot_date.tv_sec
when this option is enabled.
Fixes: c86250bce29f ("Introduction of the "log -T" option...")
Signed-off-by: Dave Wysochanski <dwysocha(a)redhat.com>
Reviewed-by: Wang Long <w(a)laoqinren.net>
Tested-by: Mathias Krause <minipli(a)grsecurity.net>
---
kernel.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel.c b/kernel.c
index 5ed6021..95119f3 100644
--- a/kernel.c
+++ b/kernel.c
@@ -4939,7 +4939,10 @@ cmd_log(void)
if (argerrs)
cmd_usage(pc->curcmd, SYNOPSIS);
- if (kt->boot_date.tv_sec == 0) {
+ if (msg_flags & SHOW_LOG_CTIME && pc->flags & MINIMAL_MODE)
+ error(FATAL, "log: option 'T' not available in minimal mode\n");
+
+ if (msg_flags & SHOW_LOG_CTIME && kt->boot_date.tv_sec == 0) {
ulonglong uptime_jiffies;
ulong uptime_sec;
get_uptime(NULL, &uptime_jiffies);
--
2.27.0
4 years, 3 months
regression: crash --minimal "log" command spins at 100% cpu after c86250bce29f Introduction of the "log -T" option
by David Wysochanski
This patch broke running "log" command when "crash --minimal" is
invoked for any vmcore. This is important because sometimes there is
a damaged vmcore and the log is enough to diagnose the problem.
It looks like this is the result of this code block where machdep->hz
== 0 and we divide by 0:
@@ -4936,6 +4939,15 @@ cmd_log(void)
if (argerrs)
cmd_usage(pc->curcmd, SYNOPSIS);
+ if (kt->boot_date.tv_sec == 0) {
+ ulonglong uptime_jiffies;
+ ulong uptime_sec;
+ get_uptime(NULL, &uptime_jiffies);
+ uptime_sec = (uptime_jiffies)/(ulonglong)machdep->hz;
+ kt->boot_date.tv_sec = kt->date.tv_sec - uptime_sec;
+ kt->boot_date.tv_nsec = 0;
+ }
+
I am not sure what the correct approach is here but wanted to report
this regression. Also wanted to ask whether this project has
considered any sort of CI tests to run on checkins.
Thanks.
4 years, 3 months
[PATCH RESEND 0/3] vmss/core related fixes and enhancements
by Mathias Krause
[Resend as the original posting apaprnetly got stuck in the mail queue.]
This small patch series enhances support for VMware vmss dump and core
files by fixing some bugs I ran into.
I meanwhile realized that the register dump of patch 2 can also be seen
via 'help -r' but its formating fixes are useful nonetheless.
Please apply!
Thanks,
Mathias
Mathias Krause (3):
vmware: vmss - support huge holes in vmem
vmware: vmss - beautify and extend debug log
Support core files with "unusual" layout
netdump.c | 86 +++++++++++++++++++++++++++++++++++----------------
netdump.h | 2 ++
vmware_vmss.c | 18 +++++++++--
3 files changed, 76 insertions(+), 30 deletions(-)
--
2.20.1
4 years, 3 months
[PATCH v2 0/4] sadump, kaslr: fix failure of calculating kaslr_offset due to an sadump format restriction
by HATAYAMA Daisuke
This patch series fix failure of calculating kaslr_offset due to an
sadump format restriction.
The main part is the 4-th patch. I found some small bugs during this
work and the 2nd and 3rd are to fix them and are also needed for the
4-th patch.
This issue occurs also in makedumpfile, and I have already posted the
corresponding patch for makedumpfile at:
http://lists.infradead.org/pipermail/kexec/2020-July/020852.html
ChangeLog:
v1=>v2:
- Add Signed-off-by: in each commit description
- 4/4: Remove unused zero variable in get_sadump_smram_cpu_state_any()
- 2/4: Fix mismatch of the symbol name and the member of the symbol table
HATAYAMA Daisuke (4):
symbols: Add linux_banner_vmlinux in symbol table
symbols: fix initialization of st->{pti_init,kaiser}_vmlinux
kaslr: cleanup how to set values to the arguments of
calc_kaslr_offset()
kaslr: fix failure of calculating kaslr_offset due to an sadump format
restriction
defs.h | 1 +
kaslr_helper.c | 61 +++++++++++++++++++++++++++++++++++++++++++++-------------
sadump.c | 20 +++++++++++--------
symbols.c | 25 +++++++++++++++++++-----
4 files changed, 81 insertions(+), 26 deletions(-)
--
1.8.3.1
4 years, 3 months