diff options
author | Minchan Kim <minchan@kernel.org> | 2015-10-22 13:32:19 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-23 17:55:10 +0900 |
commit | 47aee4d8e314384807e98b67ade07f6da476aa75 (patch) | |
tree | 2dc0e6e06f45674e4dd100fd361ffb0e4d69c809 /mm/filemap.c | |
parent | b8fa0efa01109e294e9be610465c324f771cb5ba (diff) | |
download | linux-stable-47aee4d8e314384807e98b67ade07f6da476aa75.tar.gz linux-stable-47aee4d8e314384807e98b67ade07f6da476aa75.tar.bz2 linux-stable-47aee4d8e314384807e98b67ade07f6da476aa75.zip |
thp: use is_zero_pfn() only after pte_present() check
Use is_zero_pfn() on pteval only after pte_present() check on pteval
(It might be better idea to introduce is_zero_pte() which checks
pte_present() first).
Otherwise when working on a swap or migration entry and if pte_pfn's
result is equal to zero_pfn by chance, we lose user's data in
__collapse_huge_page_copy(). So if you're unlucky, the application
segfaults and finally you could see below message on exit:
BUG: Bad rss-counter state mm:ffff88007f099300 idx:2 val:3
Fixes: ca0984caa823 ("mm: incorporate zero pages into transparent huge pages")
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: <stable@vger.kernel.org> [4.1+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
0 files changed, 0 insertions, 0 deletions