Commit a2f97129 authored by Zou Nanhai's avatar Zou Nanhai Committed by Linus Torvalds

[PATCH] Fix an error in copy_page_range

There is a bug in copy_page_range with 4 level page table change. 
copy_page_range do a continue without adding pgds and addr when
pgd_none(*src_pgd) or pgd_bad(*src_pgd).
Signed-off-by: default avatarZou Nan hai <nanhai.zou@intel.com>
Acked-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d62edbe1
...@@ -442,17 +442,18 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, ...@@ -442,17 +442,18 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
if (next > end || next <= addr) if (next > end || next <= addr)
next = end; next = end;
if (pgd_none(*src_pgd)) if (pgd_none(*src_pgd))
continue; goto next_pgd;
if (pgd_bad(*src_pgd)) { if (pgd_bad(*src_pgd)) {
pgd_ERROR(*src_pgd); pgd_ERROR(*src_pgd);
pgd_clear(src_pgd); pgd_clear(src_pgd);
continue; goto next_pgd;
} }
err = copy_pud_range(dst, src, dst_pgd, src_pgd, err = copy_pud_range(dst, src, dst_pgd, src_pgd,
vma, addr, next); vma, addr, next);
if (err) if (err)
break; break;
next_pgd:
src_pgd++; src_pgd++;
dst_pgd++; dst_pgd++;
addr = next; addr = next;
......
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