Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] makedumpfile: harden parsing of old prink buffer
@ 2022-03-14 16:04 Philipp Rudo
  2022-03-14 16:04 ` [PATCH v2 1/4] makedumpfile: add generic cycle detection Philipp Rudo
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Philipp Rudo @ 2022-03-14 16:04 UTC (permalink / raw)
  To: kexec

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-03-18  5:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-14 16:04 [PATCH v2 0/4] makedumpfile: harden parsing of old prink buffer Philipp Rudo
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==?=

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox