Commit Graph
1 Commits
Author SHA1 Message Date
Peter Kang 65f523e546 xen/page_alloc: scrub each page in unprepare_staticmem_pages
unprepare_staticmem_pages() can unprepare multiple pages in a static
memory range. When need_scrub is true, each page must be scrubbed
before it is marked static.

The loop currently passes the base pointer pg to scrub_one_page() on
every iteration. For a multi-page range, this repeatedly scrubs page 0
and leaves the remaining pages unscrubbed, so a guest can later read
stale data from pages 1..nr_mfns-1 of a static or static-shared bank.

Pass &pg[i] to scrub_one_page() so each iteration scrubs the page it
is processing. This ensures every page in the range is scrubbed before
it is marked static.

Fixes: 4a9e73e6e5 ("xen/arm: static memory initialization")
Signed-off-by: Peter Kang <peter.kang@boeing.com>
2026-10-27 09:02:42 +01:00