hugetlb: fix copy_hugetlb_page_range() to handle migration/hwpoisoned entry
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Mon, 23 Jun 2014 20:22:03 +0000 (13:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 18:14:03 +0000 (11:14 -0700)
commit9b576da0f77415c2735a5bbdb581309fe22d5999
tree84bf0cf32d3b5c6d142edf73b2946d98f333f6ed
parentc78d5ed42d5ff470523c90431fdde7066e78db4d
hugetlb: fix copy_hugetlb_page_range() to handle migration/hwpoisoned entry

commit 4a705fef986231a3e7a6b1a6d3c37025f021f49f upstream.

There's a race between fork() and hugepage migration, as a result we try
to "dereference" a swap entry as a normal pte, causing kernel panic.
The cause of the problem is that copy_hugetlb_page_range() can't handle
"swap entry" family (migration entry and hwpoisoned entry) so let's fix
it.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/hugetlb.c