On Sat, 17 Oct 2026 12:34:15 +0000, Aristo Chen wrote:

> pstore display and pstore save read the records that the Linux ramoops
> driver left in RAM. This series fixes three ways in which they access
> memory past a record or a buffer. Each fix is followed by a test in
> test_pstore.py that fails without it.
> 
> Patch 1 checks the record header. pstore_get_buffer() copies the bytes
> from offset start to the end of the record, but only rejected a record
> whose size is 0 or larger than its zone, so a start beyond the size made
> the length wrap around and crashed U-Boot. The ftrace records are read
> without checking their signature, so leftover data in RAM is enough.
> The record is now rejected, as Linux does in persistent_ram_post_init(),
> when its size does not fit in the zone after the 12-byte header or its
> start is beyond its size. Patch 2 writes such headers and checks that
> the records are skipped.
> 
> [...]

Applied to u-boot/main, thanks!

[1/6] cmd: pstore: check the record header before using it
      commit: ca0b83af174cb1d9fa9d227aeb535acbc5c4a493
[2/6] test: pstore: check that records with an invalid header are skipped
      commit: 748d8fba4dd3e3b0adabc8228dd6d7bf14e2495d
[3/6] cmd: pstore: size the buffer again after pstore set
      commit: 2b03bc4d7dfa2ecd0ed8d623ee0bdd94b0fca605
[4/6] test: pstore: check pstore save after a record is made larger
      commit: c24eb8c92cf88f8a1975430a64fac6641db8d724
[5/6] cmd: pstore: look for the end of the dump header within the record
      commit: f5794cf41b8bbfd6af847b11a2de86ba22216867
[6/6] test: pstore: check a dump record whose header line is cut
      commit: 885d0fa66485d8a046ac56473bb3b3ee9985fe17
-- 
Tom


Reply via email to