Files
Christoph Hellwig cba5a7834e UPSTREAM: asm-generic: add an optional pfn_valid check to page_to_phys
page_to_pfn is usually implemented by pointer arithmetics on the memory
map, which means that bogus input can lead to even more bogus output.

Powerpc had a pfn_valid check on the intermediate pfn in the page_to_phys
implementation when CONFIG_DEBUG_VIRTUAL is defined, which seems
generally useful, so add that to the generic version.

Bug: 399192075

Change-Id: I078e75dbecaac9f70306ed8472ab1d68c97ad2f5
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit 3e25d5a49f99b75be2c6cfb165e4f77dc6d739a2)
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
2025-03-19 13:28:28 +00:00

2.0 KiB