mm/gup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 102877ed77a4..8966d3c89e5d 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2182,8 +2182,11 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end, undo_dev_pagemap(nr, nr_start, flags, pages); goto pte_unmap; } - } else if (pte_special(pte)) - goto pte_unmap; + } else if (pte_special(pte)) { + if (!is_zero_pfn(pte_pfn(pte))) + goto pte_unmap; + /* We'll allow the zero page - like follow_page_pte() does */ + } VM_BUG_ON(!pfn_valid(pte_pfn(pte))); page = pte_page(pte);