From: Philipp Rudo <prudo@redhat.com>
To: kexec@lists.infradead.org
Subject: [PATCH v2 0/4] makedumpfile: harden parsing of old prink buffer
Date: Mon, 14 Mar 2022 17:04:28 +0100 [thread overview]
Message-ID: <20220314160432.9414-1-prudo@redhat.com> (raw)
Hi,
dumping the dmesg can cause an endless loop for the old prink mechanism (>
v3.5.0 and < v5.10.0) when the log_buf got corrupted. This series fixes those
cases by adding a cycle detection. The cycle detection is implemented in a
generic way so that it can be reused in other parts of makedumpfile.
Thanks
Philipp
v2:
* Rename 'idx' to 'ptr'
* Also print the non-loop part when a cycle was detected. Such a
situation can happen when log_buf wrapped around in the kernel
(log_first_idx != 0) and the corruption occurred on an
idx < log_first_idx.
* Add patch 4 fixing a bug independent from the memory corruption but
found while investigating it.
Philipp Rudo (4):
makedumpfile: add generic cycle detection
makedumpfile: use pointer arithmetics for dump_dmesg
makedumpfile: use cycle detection when parsing the prink log_buf
makedumpfile: print error when reading with unsupported compression
Makefile | 2 +-
detect_cycle.c | 99 +++++++++++++++++++++++++++++++++++++
detect_cycle.h | 40 +++++++++++++++
makedumpfile.c | 131 ++++++++++++++++++++++++++++++++++++++++---------
4 files changed, 247 insertions(+), 25 deletions(-)
create mode 100644 detect_cycle.c
create mode 100644 detect_cycle.h
--
2.35.1
next reply other threads:[~2022-03-14 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-14 16:04 Philipp Rudo [this message]
2022-03-14 16:04 ` [PATCH v2 1/4] makedumpfile: add generic cycle detection Philipp Rudo
2022-03-14 16:04 ` [PATCH v2 2/4] makedumpfile: use pointer arithmetics for dump_dmesg Philipp Rudo
2022-03-18 5:28 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
2022-03-14 16:04 ` [PATCH v2 3/4] makedumpfile: use cycle detection when parsing the prink log_buf Philipp Rudo
2022-03-14 16:04 ` [PATCH v2 4/4] makedumpfile: print error when reading with unsupported compression Philipp Rudo
2022-03-18 5:28 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
2022-03-16 13:17 ` [PATCH v2 0/4] makedumpfile: harden parsing of old prink buffer David Wysochanski
2022-03-16 14:09 ` David Wysochanski
2022-03-18 5:30 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220314160432.9414-1-prudo@redhat.com \
--to=prudo@redhat.com \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox