makedumpfile: harden parsing of old prink buffer
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 0 repliesNew
- v13 patches 0 repliesSuperseded
Changes in v2 from the cover letter
* 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.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | makedumpfile: add generic cycle detectionMakefile detect_cycle.c detect_cycle.h | +140 | 0 replies | |
| 2/4 | makedumpfile: use pointer arithmetics for dump_dmesgmakedumpfile.c | +13 | 1 reply | |
| 3/4 | makedumpfile: use cycle detection when parsing the prink log_bufmakedumpfile.c | +47 | 0 replies | |
| 4/4 | makedumpfile: print error when reading with unsupported compressionmakedumpfile.c | +48 | 1 reply |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by.
| Patch | Dave Wysochanski |
|---|---|
| Series | Reviewed-and-tested-by |
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/4] makedumpfile: harden parsing of old prink buffer
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
Signature · 1 line
2.35.1