Commit 7cdb530e authored by Linus Torvalds's avatar Linus Torvalds

Don't allow rmap to touch reserved or out-of-range pages

parent 8098016d
...@@ -292,13 +292,11 @@ skip_copy_pmd_range: address = (address + PGDIR_SIZE) & PGDIR_MASK; ...@@ -292,13 +292,11 @@ skip_copy_pmd_range: address = (address + PGDIR_SIZE) & PGDIR_MASK;
* and not mapped via rmap - duplicate the * and not mapped via rmap - duplicate the
* mapping as is. * mapping as is.
*/ */
if (!pfn_valid(pfn)) { page = pfn_to_page(pfn);
if (!pfn_valid(pfn) || PageReserved(page)) {
set_pte(dst_pte, pte); set_pte(dst_pte, pte);
goto cont_copy_pte_range_noset; goto cont_copy_pte_range_noset;
} }
page = pfn_to_page(pfn);
if (PageReserved(page))
goto cont_copy_pte_range;
/* /*
* If it's a COW mapping, write protect it both * If it's a COW mapping, write protect it both
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment