]> git.baikalelectronics.ru Git - kernel.git/commit
mm/migrate: check-before-clear PageSwapCache
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Wed, 15 Apr 2015 23:13:15 +0000 (16:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 23:35:17 +0000 (16:35 -0700)
commit4d644b5d2c3b6b90fac3b30e1fd94c64e7ce5d0e
tree64b7488c4046b15c39b6874380cba7207e91e5a1
parent565d976fa0d05f93d8bdd7a7ed780f909574cafe
mm/migrate: check-before-clear PageSwapCache

With the page flag sanitization patchset, an invalid usage of
ClearPageSwapCache() is detected in migration_page_copy().
migrate_page_copy() is shared by both normal and hugepage (both thp and
hugetlb) code path, so let's check PageSwapCache() and clear it if it's
set to avoid misuse of the invalid clear operation.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/migrate.c